[FFmpeg-trac] #3062(undetermined:closed): Concatenating ends with corrupted mp4 file.
FFmpeg
trac at avcodec.org
Mon Oct 21 14:32:54 CEST 2013
#3062: Concatenating ends with corrupted mp4 file.
-------------------------------------+-------------------------------------
Reporter: alikayahan | Owner:
Type: defect | Status: closed
Priority: normal | Component:
Version: git-master | undetermined
Keywords: | Resolution:
Blocking: | worksforme
Analyzed by developer: 0 | Blocked By:
| Reproduced by developer: 0
-------------------------------------+-------------------------------------
Changes (by cehoyos):
* status: new => closed
* version: 2.0.1 => git-master
* resolution: => worksforme
Comment:
I tested the following:
{{{
$ ./ffmpeg -i tests/lena.pnm -pix_fmt yuvj420p out.jpg
ffmpeg version N-57290-g87eae03 Copyright (c) 2000-2013 the FFmpeg
developers
built on Oct 21 2013 14:17:38 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --enable-libx264
libavutil 52. 47.101 / 52. 47.101
libavcodec 55. 37.102 / 55. 37.102
libavformat 55. 19.103 / 55. 19.103
libavdevice 55. 4.100 / 55. 4.100
libavfilter 3. 88.102 / 3. 88.102
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, image2, from 'tests/lena.pnm':
Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
Stream #0:0: Video: ppm, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0x2254380] deprecated pixel format used, make sure you did set
range correctly
Output #0, image2, to 'out.jpg':
Metadata:
encoder : Lavf55.19.103
Stream #0:0: Video: mjpeg, yuvj420p, 256x256, q=2-31, 200 kb/s, 90k
tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (ppm -> mjpeg)
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:12kB audio:0kB subtitle:0 global headers:0kB muxing overhead
-100.177334%
}}}
{{{
$ cat out.jpg | ./ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - -vcodec
libx264 /out1.mp4 /out2.mp4
ffmpeg version N-57290-g87eae03 Copyright (c) 2000-2013 the FFmpeg
developers
built on Oct 21 2013 14:17:38 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --enable-libx264
libavutil 52. 47.101 / 52. 47.101
libavcodec 55. 37.102 / 55. 37.102
libavformat 55. 19.103 / 55. 19.103
libavdevice 55. 4.100 / 55. 4.100
libavfilter 3. 88.102 / 3. 88.102
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, image2pipe, from 'pipe:':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc), 256x256, 1 tbr, 1 tbn, 1 tbc
No pixel format specified, yuvj420p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
Last message repeated 1 times
[libx264 @ 0x2c5c640] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2 AVX
[libx264 @ 0x2c5c640] profile High, level 1.2
[libx264 @ 0x2c5c640] 264 - core 128 - H.264/MPEG-4 AVC codec - Copyleft
2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0
deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=1
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libx264 @ 0x2c5de60] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2 AVX
[libx264 @ 0x2c5de60] profile High, level 1.2
[libx264 @ 0x2c5de60] 264 - core 128 - H.264/MPEG-4 AVC codec - Copyleft
2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0
deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12
lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=1
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/out1.mp4':
Metadata:
encoder : Lavf55.19.103
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p,
256x256, q=-1--1, 16384 tbn, 1 tbc
Output #1, mp4, to '/out2.mp4':
Metadata:
encoder : Lavf55.19.103
Stream #1:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuvj420p,
256x256, q=-1--1, 16384 tbn, 1 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> libx264)
Stream #0:0 -> #1:0 (mjpeg -> libx264)
pipe:: Input/output error
frame= 1 fps=0.0 q=17.0 Lq=17.0 size= 15kB time=00:00:01.00
bitrate= 119.5kbits/s
video:28kB audio:0kB subtitle:0 global headers:0kB muxing overhead
-47.316075%
[libx264 @ 0x2c5c640] frame I:1 Avg QP:19.09 size: 13463
[libx264 @ 0x2c5c640] mb I I16..4: 2.3% 96.1% 1.6%
[libx264 @ 0x2c5c640] 8x8 transform intra:96.1%
[libx264 @ 0x2c5c640] coded y,uvDC,uvAC intra: 98.6% 99.2% 89.5%
[libx264 @ 0x2c5c640] i16 v,h,dc,p: 33% 0% 0% 67%
[libx264 @ 0x2c5c640] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 7% 18% 9% 5%
7% 3% 12% 6%
[libx264 @ 0x2c5c640] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 48% 6% 5% 11% 3%
8% 2% 12% 5%
[libx264 @ 0x2c5c640] i8c dc,h,v,p: 41% 7% 37% 16%
[libx264 @ 0x2c5c640] kb/s:107.70
[libx264 @ 0x2c5de60] frame I:1 Avg QP:19.09 size: 13463
[libx264 @ 0x2c5de60] mb I I16..4: 2.3% 96.1% 1.6%
[libx264 @ 0x2c5de60] 8x8 transform intra:96.1%
[libx264 @ 0x2c5de60] coded y,uvDC,uvAC intra: 98.6% 99.2% 89.5%
[libx264 @ 0x2c5de60] i16 v,h,dc,p: 33% 0% 0% 67%
[libx264 @ 0x2c5de60] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 7% 18% 9% 5%
7% 3% 12% 6%
[libx264 @ 0x2c5de60] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 48% 6% 5% 11% 3%
8% 2% 12% 5%
[libx264 @ 0x2c5de60] i8c dc,h,v,p: 41% 7% 37% 16%
[libx264 @ 0x2c5de60] kb/s:107.70
}}}
{{{
$ ./ffmpeg -f concat -i <(for f in /out*.mp4; do echo "file '$f'"; done)
-r 1 -c copy out.mp4
ffmpeg version N-57290-g87eae03 Copyright (c) 2000-2013 the FFmpeg
developers
built on Oct 21 2013 14:17:38 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --enable-libx264
libavutil 52. 47.101 / 52. 47.101
libavcodec 55. 37.102 / 55. 37.102
libavformat 55. 19.103 / 55. 19.103
libavdevice 55. 4.100 / 55. 4.100
libavfilter 3. 88.102 / 3. 88.102
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, concat, from '/dev/fd/63':
Duration: N/A, start: 0.000000, bitrate: 113 kb/s
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc),
256x256, 113 kb/s, 1 fps, 1 tbr, 16384 tbn, 2 tbc
Output #0, mp4, to 'out.mp4':
Metadata:
encoder : Lavf55.19.103
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 256x256,
q=2-31, 113 kb/s, 1 fps, 16384 tbn, 1 tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 2 fps=0.0 q=-1.0 Lsize= 28kB time=00:00:02.00 bitrate=
116.3kbits/s
video:28kB audio:0kB subtitle:0 global headers:0kB muxing overhead
2.825518%
}}}
The output file plays fine here with ffplay and can be decoded with
ffmpeg:
{{{
$ ./ffmpeg -i out.mp4 -f framecrc -
ffmpeg version N-57290-g87eae03 Copyright (c) 2000-2013 the FFmpeg
developers
built on Oct 21 2013 14:17:38 with gcc 4.7 (SUSE Linux)
configuration: --enable-gpl --enable-libx264
libavutil 52. 47.101 / 52. 47.101
libavcodec 55. 37.102 / 55. 37.102
libavformat 55. 19.103 / 55. 19.103
libavdevice 55. 4.100 / 55. 4.100
libavfilter 3. 88.102 / 3. 88.102
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.19.103
Duration: 00:00:02.00, start: 0.000000, bitrate: 116 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661),
yuvj420p(pc), 256x256, 113 kb/s, 1 fps, 1 tbr, 16384 tbn, 2 tbc (default)
Metadata:
handler_name : VideoHandler
#tb 0: 1/1
Output #0, framecrc, to 'pipe:':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.19.103
Stream #0:0(und): Video: rawvideo (I420 / 0x30323449), yuvj420p,
256x256, q=2-31, 200 kb/s, 1 tbn, 1 tbc (default)
Metadata:
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> rawvideo)
Press [q] to stop, [?] for help
0, 0, 0, 1, 98304, 0x985374d7
0, 1, 1, 1, 98304, 0x985374d7
frame= 2 fps=0.0 q=0.0 Lsize= 0kB time=00:00:02.00 bitrate=
0.5kbits/s
video:192kB audio:0kB subtitle:0 global headers:0kB muxing overhead
-99.935404%
}}}
If you want to reopen this ticket, please test with {{{-vcodec mpeg4}}}
instead of h264, this makes reproducing the issue much easier and please
also test with tests/lena.pnm (part of FFmpeg source distribution).
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/3062#comment:3>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list