Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th February 2015, 00:30   #1  |  Link
CoRoNe
Registered User
 
CoRoNe's Avatar
 
Join Date: Nov 2005
Posts: 644
FFMpeg error while muxing a hls-videostream to matroska.

Code:
ffmpeg.exe -hide_banner -i npo-hls.m3u8 -c copy -bsf:a aac_adtstoasc "npo-hls.mp4"
Input #0, hls,applehttp, from 'http://xxx.npostreaming.nl/npo-hls.m3u8':
  Duration: 00:21:09.00, start: 1.000000, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 156 kb/s
    Stream #0:1: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p,
                        608x342 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Output #0, mp4, to 'npo-hls.mp4':
  Metadata:
    encoder         : Lavf56.21.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 608x342 [SAR 1:1 DAR 16:9],
                        q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 156 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
No problem at all. But...

Code:
ffmpeg.exe -hide_banner -i npo-hls.m3u8 -c copy "npo-hls.mkv"
Input #0, hls,applehttp, from 'http://xxx.npostreaming.nl/npo-hls.m3u8':
  Duration: 00:21:09.00, start: 1.000000, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 156 kb/s
    Stream #0:1: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p,
                        608x342 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
[matroska @ 03d81020] Error parsing AAC extradata, unable to determine samplerate.
Output #0, mp4, to 'npo-hls.mkv':
  Metadata:
    encoder         : Lavf56.21.100
    Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 608x342 [SAR 1:1 DAR 16:9],
                        q=2-31, 25 fps, 25 tbr, 1k tbn, 90k tbc
    Stream #0:1: Audio: aac ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, 156 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Muxing to matroska fails. Is this a known issue? Does anyone know if this can be fixed?

(ffmpeg version used: 20150215-git-2a72b16, video-link: youtube-dl.exe -gf m3u8-1196 http://www.npo.nl/nos-journaal/14-02-2015/POW_00942207)
__________________
My hobby website
CoRoNe is offline   Reply With Quote
Old 26th February 2015, 01:03   #2  |  Link
xooyoozoo
Registered User
 
Join Date: Dec 2012
Posts: 199
I'm not sure, but you have different command lines for each, so maybe that's why?

ADTS doesn't signal SBR (which changes the samplerate), so a muxer cannot be sure of AAC's samplerate without doing lower-level decoding. I guess this is where a bitstream filter becomes useful, like in your .mp4 command.
xooyoozoo is offline   Reply With Quote
Old 26th February 2015, 01:04   #3  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 8,989
ADTS AAC (as in a TS stream) cannot be muxed into MKV officially, although some tools have historically allowed it (and even ffmpeg at one time), you should use the same bitstream filter you used for the MP4 case as well.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 26th February 2015, 01:37   #4  |  Link
CoRoNe
Registered User
 
CoRoNe's Avatar
 
Join Date: Nov 2005
Posts: 644
It doesn't matter whether I use -bsf:a aac_adtstoasc for muxing to matroska or not. The same error shows up.
__________________
My hobby website
CoRoNe is offline   Reply With Quote
Old 26th February 2015, 20:10   #5  |  Link
CoRoNe
Registered User
 
CoRoNe's Avatar
 
Join Date: Nov 2005
Posts: 644
So if you want to mux to mkv, at the moment there's no other option than to mux to and create a temporary mp4-file?
__________________
My hobby website
CoRoNe is offline   Reply With Quote
Old 25th December 2016, 20:58   #6  |  Link
CoRoNe
Registered User
 
CoRoNe's Avatar
 
Join Date: Nov 2005
Posts: 644
I knew FFMpeg had already fixed this issue, but finding this old thread now, I thought I'd mention to conclude this thread:

Code:
ffmpeg.exe -hide_banner -i "npo-hls.m3u8" -c copy "npo-hls.mkv"
Input #0, hls,applehttp, from 'http://xxx.npostreaming.nl/npo-hls.m3u8':
  Duration: 00:24:59.00, start: 10.000000, bitrate: 0 kb/s
  Program 0
    Metadata:
      variant_bitrate : 0
    Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p,
                        1024x576 [SAR 1:1 DAR 16:9], 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 0
Output #0, matroska, to '..\npo-hls.mkv':
  Metadata:
    encoder         : Lavf57.58.101
    Stream #0:0: Video: h264 (Constrained Baseline) (H264 / 0x34363248), yuv420p,
                        1024x576 [SAR 1:1 DAR 16:9], q=2-31, 25 tbr, 1k tbn, 90k tbc
    Metadata:
      variant_bitrate : 0
    Stream #0:1: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 0
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
__________________
My hobby website
CoRoNe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.