#2805 closed defect (invalid)
Can not demux to elementary .h264
Reported by: | mikhailov | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | unspecified | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
Impossible to mux elementary video stream that were demuxed with ffmpeg before (h264 video stream).
How to reproduce:
% ffmpeg -i input.flv -c:v copy -c:a libvo_aacenc -ab 96k -ac 1 output_0.mp4 % ffmpeg -i output_0.mp4 -an -c:v copy output.h264 % ffmpeg -i output_0.mp4 -vn -c:a copy output.aac % ffmpeg -i output.h264 -i output.aac -c copy result.mp4 ffmpeg version built on Jul 23 2013 11:51:12 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libfaac --enable-libvo-aacenc --enable-libspeex libavutil 52. 38.100 / 52. 38.100 libavcodec 55. 18.102 / 55. 18.102 libavformat 55. 12.100 / 55. 12.100 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 79.101 / 3. 79.101 libavresample 1. 1. 0 / 1. 1. 0 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100
The problem is with that log ffmpeg stderr: output.h264: Invalid data found when processing input
The logs details below:
$ ffmpeg -i input.flv -c:v copy -c:a libvo_aacenc -ab 96k -ac 1 output_0.mp4 ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 23 2013 11:51:12 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libfaac --enable-libvo-aacenc --enable-libspeex Input #0, flv, from 'input.flv': Metadata: creationdate : Sat Jul 20 16:03:03 duration2 : 8227 Duration: 00:00:08.53, start: 0.000000, bitrate: 340 kb/s Stream #0:0: Video: h264 (Baseline), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 20 tbr, 1k tbn, 40 tbc Stream #0:1: Audio: speex, 16000 Hz, mono, s16 Output #0, mp4, to 'output_0.mp4': Metadata: creationdate : Sat Jul 20 16:03:03 duration2 : 8227 encoder : Lavf55.12.100 Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 16k tbn, 1k tbc Stream #0:1: Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 16000 Hz, mono, s16, 96 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (libspeex -> libvo_aacenc) Press [q] to stop, [?] for help [mp4 @ 0x7f96e2131000] Non-monotonous DTS in output stream 0:0; previous: 45776, current: 45776; changing to 45777. This may result in incorrect timestamps in the output file. [mp4 @ 0x7f96e2131000] Non-monotonous DTS in output stream 0:0; previous: 91120, current: 91120; changing to 91121. This may result in incorrect timestamps in the output file. [mp4 @ 0x7f96e2131000] Non-monotonous DTS in output stream 0:0; previous: 135888, current: 135888; changing to 135889. This may result in incorrect timestamps in the output file. frame= 124 fps=0.0 q=-1.0 Lsize= 411kB time=00:00:08.59 bitrate= 391.9kbits/s video:316kB audio:91kB subtitle:0 global headers:0kB muxing overhead 0.991790% $ ffmpeg -i output_0.mp4 -an -c:v copy output.h264 ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 23 2013 11:51:12 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libfaac --enable-libvo-aacenc --enable-libspeex Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output_0.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf55.12.100 Duration: 00:00:08.54, start: 0.000000, bitrate: 394 kb/s Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 303 kb/s, 14.51 fps, 20 tbr, 16k tbn, 40 tbc Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 95 kb/s Metadata: handler_name : SoundHandler Output #0, h264, to 'output.h264': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf55.12.100 Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 303 kb/s, 14.51 fps, 90k tbn, 20 tbc Metadata: handler_name : VideoHandler Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help frame= 124 fps=0.0 q=-1.0 Lsize= 316kB time=00:00:08.54 bitrate= 303.4kbits/s video:316kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.000000% $ ffmpeg -i output_0.mp4 -vn -c:a copy output.aac ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 23 2013 11:51:12 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libfaac --enable-libvo-aacenc --enable-libspeex Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output_0.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf55.12.100 Duration: 00:00:08.54, start: 0.000000, bitrate: 394 kb/s Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 303 kb/s, 14.51 fps, 20 tbr, 16k tbn, 40 tbc Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 95 kb/s Metadata: handler_name : SoundHandler Output #0, adts, to 'output.aac': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf55.12.100 Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, 95 kb/s Metadata: handler_name : SoundHandler Stream mapping: Stream #0:1 -> #0:0 (copy) Press [q] to stop, [?] for help size= 92kB time=00:00:08.59 bitrate= 87.3kbits/s video:0kB audio:91kB subtitle:0 global headers:0kB muxing overhead 0.911458% $ ffmpeg -i output.h264 -i output.aac -c copy result.mp4 ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 23 2013 11:51:12 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.0 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libfaac --enable-libvo-aacenc --enable-libspeex output.h264: Invalid data found when processing input
Attachments (1)
Change History (11)
by , 12 years ago
comment:2 by , 12 years ago
Keywords: | mux demux h.264 removed |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:3 by , 12 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
The bug can be reproduced even on git head, built by using brew install ffmpeg --HEAD...
ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 23 2013 12:59:47 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libfaac --enable-libvo-aacenc --enable-libspeex libavutil 52. 40.100 / 52. 40.100 libavcodec 55. 19.100 / 55. 19.100 libavformat 55. 12.102 / 55. 12.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 81.102 / 3. 81.102 libavresample 1. 1. 0 / 1. 1. 0 libswscale 2. 4.100 / 2. 4.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100
It is HEAD and bases on those recent commits:
7dc7761 [4 hours ago] (Michael Niedermayer) Merge remote-tracking branch 'qatar/master' abc8110 [6 days ago] (Michael Niedermayer) avcodec: add avcodec_chroma_pos_to_enum() 69e6702 [27 hours ago] (Martin Storsjö) arm: Mangle external symbols properly in new vfp assembly files
follow-up: 5 comment:4 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
follow-up: 7 comment:6 by , 12 years ago
Replying to mikhailov:
Replying to cehoyos:
Why is this ticket invalid?
It contains a user question - "How do I extract raw H264 (Annex B) streams from valid mp4 (and flv) files?" - and this is not the right place for user questions. Please note that I tried very hard to answer the question in comment:2, I additionally repeated the need for always testing current git head - as explained on http://ffmpeg.org/bugreports.html - but this has of course no relevance for this ticket but only for future ones. Finally, I made a comment about encoding aac. I still consider this a very complete answer and honestly cannot understand why you reopened the ticket - especially without even commenting on my answer to your original question or indicating that you tested the example commands.
follow-up: 9 comment:7 by , 12 years ago
Replying to cehoyos:
Replying to mikhailov:
Replying to cehoyos:
Why is this ticket invalid?
It contains a user question - "How do I extract raw H264 (Annex B) streams from valid mp4 (and flv) files?" - and this is not the right place for user questions. Please note that I tried very hard to answer the question in comment:2, I additionally repeated the need for always testing current git head - as explained on http://ffmpeg.org/bugreports.html - but this has of course no relevance for this ticket but only for future ones. Finally, I made a comment about encoding aac. I still consider this a very complete answer and honestly cannot understand why you reopened the ticket - especially without even commenting on my answer to your original question or indicating that you tested the example commands.
This ticket does contain only one question: why demux doesn't work as described in documentation. The problem may relate to the another ticket such #2085 that still unresolved. Yes, thanks for the advice to use git HEAD, I did it, result was the same. AAC codec doesn't affect to this problem as you said about it as "Unrelated".
comment:8 by , 12 years ago
Please read comment:2 again, concentrate only on the first two lines, ignore the remark about git head until you decide to report the next problem, this is what I meant with "For future tickets".
And please consider asking usage questions on the user mailing lists.
comment:9 by , 12 years ago
Replying to mikhailov:
Replying to cehoyos:
Replying to mikhailov:
Replying to cehoyos:
Why is this ticket invalid?
It contains a user question - "How do I extract raw H264 (Annex B) streams from valid mp4 (and flv) files?" - and this is not the right place for user questions. Please note that I tried very hard to answer the question in comment:2, I additionally repeated the need for always testing current git head - as explained on http://ffmpeg.org/bugreports.html - but this has of course no relevance for this ticket but only for future ones. Finally, I made a comment about encoding aac. I still consider this a very complete answer and honestly cannot understand why you reopened the ticket - especially without even commenting on my answer to your original question or indicating that you tested the example commands.
This ticket does contain only one question: why demux doesn't work as described in documentation. The problem may relate to the another ticket such #2085 that still unresolved. Yes, thanks for the advice to use git HEAD, I did it, result was the same. AAC codec doesn't affect to this problem as you said about it as "Unrelated".
Sorry, I just reread it again. Thank you so much, those line looks interesting:
$ ffmpeg -i input.flv -vcodec copy -vbsf h264_mp4toannexb out1.h264 $ ffmpeg -i output_0.mp4 -vcodec copy -vbsf h264_mp4toannexb out2.h264
Are these resulted files (out1.h264, out2.h264) elementary raw streams or still wrap into container? The 2 command produces the same file size, but with different errors:
ffmpeg -i input.flv -vcodec copy -vbsf h264_mp4toannexb out1.h264 ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 23 2013 13:12:04 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libfaac --enable-libvo-aacenc --enable-libspeex libavutil 52. 40.100 / 52. 40.100 libavcodec 55. 19.100 / 55. 19.100 libavformat 55. 12.102 / 55. 12.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 81.102 / 3. 81.102 libavresample 1. 1. 0 / 1. 1. 0 libswscale 2. 4.100 / 2. 4.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 Input #0, flv, from 'input.flv': Metadata: creationdate : Mon Oct 22 21:17:12 duration2 : 7497 Duration: 00:00:07.78, start: 0.000000, bitrate: 280 kb/s Stream #0:0: Video: h264 (Baseline), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 20 tbr, 1k tbn, 40 tbc Stream #0:1: Audio: speex, 16000 Hz, mono, s16 Output #0, h264, to 'out1.h264': Metadata: creationdate : Mon Oct 22 21:17:12 duration2 : 7497 encoder : Lavf55.12.102 Stream #0:0: Video: h264, yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 90k tbn, 20 tbc Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid argument [h264 @ 0x7fe71a830200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 186390 >= 186390 [h264 @ 0x7fe71a830200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 289890 >= 289890 Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid argument [h264 @ 0x7fe71a830200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 368370 >= 368370 [h264 @ 0x7fe71a830200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 373860 >= 373860 [h264 @ 0x7fe71a830200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 419670 >= 419670 Last message repeated 1 times [h264 @ 0x7fe71a830200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 445500 >= 445500 Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid argument [h264 @ 0x7fe71a830200] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 548280 >= 548280 frame= 155 fps=0.0 q=-1.0 Lsize= 236kB time=00:00:07.75 bitrate= 249.6kbits/s video:237kB audio:0kB subtitle:0 global headers:0kB muxing overhead -0.113938% ffmpeg -i output_0.mp4 -vcodec copy -vbsf h264_mp4toannexb out2.h264 ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 23 2013 13:12:04 with Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=cc --host-cflags= --host-ldflags= --enable-libfaac --enable-libvo-aacenc --enable-libspeex libavutil 52. 40.100 / 52. 40.100 libavcodec 55. 19.100 / 55. 19.100 libavformat 55. 12.102 / 55. 12.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 81.102 / 3. 81.102 libavresample 1. 1. 0 / 1. 1. 0 libswscale 2. 4.100 / 2. 4.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output_0.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf55.12.102 Duration: 00:00:07.93, start: 0.100000, bitrate: 345 kb/s Stream #0:0(und): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 251 kb/s, 20.12 fps, 20 tbr, 16k tbn, 40 tbc Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, fltp, 96 kb/s Metadata: handler_name : SoundHandler Output #0, h264, to 'out2.h264': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf55.12.102 Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=2-31, 251 kb/s, 20.12 fps, 90k tbn, 20 tbc Metadata: handler_name : VideoHandler Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid argument Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid argument Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid argument frame= 155 fps=0.0 q=-1.0 Lsize= 236kB time=00:00:07.85 bitrate= 246.5kbits/s video:237kB audio:0kB subtitle:0 global headers:0kB muxing overhead -0.113938%
comment:10 by , 12 years ago
Great, it works:
ffmpeg -i input.flv -an -c:v copy -vbsf h264_mp4toannexb output.h264 ffmpeg -i input.flv -vn -c:a libvo_aacenc -ab 96k -ac 1 output.aac ffmpeg -i output.h264 -i output.aac -c copy -bsf:a aac_adtstoasc output.mp4
But it produces few out-of-sync issues. Ticket #2085 provides out-of-sync as well.
$ ffmpeg -i input.flv -vcodec copy -vbsf h264_mp4toannexb out1.h264
$ ffmpeg -i output_0.mp4 -vcodec copy -vbsf h264_mp4toannexb out2.h264
For future tickets: Please always test current git head before reporting a problem and please understand that this is a bug tracker, use the mailing lists for support questions: https://ffmpeg.org/contact.html
Unrelated: The native aac encoder
-acodec aac -strict -2
is said to be superior over-acodec libvo_aacenc
in many cases.