Opened 6 years ago
Last modified 16 months ago
#7651 open defect
Corrupted start of mp4 file after "-ss 0 -to XXX -c copy"
Reported by: | v0lt | Owned by: | |
---|---|---|---|
Priority: | important | Component: | undetermined |
Version: | git-master | Keywords: | mov |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
Summary of the bug:
The beginning of the file is corrupted when copying data, even if "-ss 0" is specified. Any other value for "-ss" (indicating a keyframe, of course) can also give a problem.
It looks like #7644, but this is a bug.
How to reproduce:
ffmpeg version N-92868-g51b356eef8
I run the following commands.
ffplay "movie.mp4" ffmpeg -hide_banner -i "movie.mp4" -ss 0.000 -to 603.480 -c copy "movie.1.mp4" ffplay "movie.1.mp4"
"movie.mp4" plays without errors.
"movie.1.mp4" play with an error at the beginning of the playback.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000459900] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720, 417 kb/s): unspecifi ed pixel format Consider increasing the value for the 'analyzeduration' and 'probesize' options
MPC-HC and MPC-BE players have a black screen at the start of playback.
Attachments (1)
Change History (5)
comment:1 by , 6 years ago
follow-up: 3 comment:2 by , 6 years ago
Keywords: | mov added |
---|---|
Reproduced by developer: | set |
Status: | new → open |
For future tickets: Do not use -hide_banner
and provide the command line you tested together with the complete, uncut console output to make your tickets valid.
If there is an issue it is a regression since 3fa72de8 / 56ee3f9d
$ ffmpeg -i movie_cut.mp4 -vcodec copy -acodec copy -ss 0 -t 10 out.mov ffmpeg version N-93028-gd8ebfd1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 6.4.0 (GCC) configuration: --enable-opengl --enable-gpl --enable-libxml2 --enable-gnutls --enable-gmp --enable-version3 --enable-libx264 libavutil 56. 26.100 / 56. 26.100 libavcodec 58. 44.100 / 58. 44.100 libavformat 58. 26.100 / 58. 26.100 libavdevice 58. 6.101 / 58. 6.101 libavfilter 7. 48.100 / 7. 48.100 libswscale 5. 4.100 / 5. 4.100 libswresample 3. 4.100 / 3. 4.100 libpostproc 55. 4.100 / 55. 4.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'movie_cut.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2018-10-21T16:02:52.000000Z Duration: 00:40:34.73, start: 0.000000, bitrate: 8 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 510 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default) Metadata: creation_time : 2018-10-21T16:02:52.000000Z handler_name : ISO Media file produced by Google Inc. Created on: 10/21/2018. Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default) Metadata: creation_time : 2018-10-21T16:02:52.000000Z handler_name : ISO Media file produced by Google Inc. Created on: 10/21/2018. Output #0, mov, to 'out.mov': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 encoder : Lavf58.26.100 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 510 kb/s, 25 fps, 25 tbr, 90k tbn, 90k tbc (default) Metadata: creation_time : 2018-10-21T16:02:52.000000Z handler_name : ISO Media file produced by Google Inc. Created on: 10/21/2018. Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default) Metadata: creation_time : 2018-10-21T16:02:52.000000Z handler_name : ISO Media file produced by Google Inc. Created on: 10/21/2018. Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 123 fps=0.0 q=-1.0 Lsize= 442kB time=00:00:09.98 bitrate= 362.3kbits/s speed=4.38e+03x video:282kB audio:154kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.417745%
$ ffmpeg -i out.mov ffmpeg version N-93028-gd8ebfd1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 6.4.0 (GCC) configuration: --enable-opengl --enable-gpl --enable-libxml2 --enable-gnutls --enable-gmp --enable-version3 --enable-libx264 libavutil 56. 26.100 / 56. 26.100 libavcodec 58. 44.100 / 58. 44.100 libavformat 58. 26.100 / 58. 26.100 libavdevice 58. 6.101 / 58. 6.101 libavfilter 7. 48.100 / 7. 48.100 libswscale 5. 4.100 / 5. 4.100 libswresample 3. 4.100 / 3. 4.100 libpostproc 55. 4.100 / 55. 4.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3dc1240] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1280x720, 469 kb/s): unspecified pixel format Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mov': Metadata: major_brand : qt minor_version : 512 compatible_brands: qt encoder : Lavf58.26.100 Duration: 00:00:10.01, start: 0.000000, bitrate: 361 kb/s Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), none, 1280x720, 469 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 90k tbn, 180k tbc (default) Metadata: handler_name : ISO Media file produced by Google Inc. Created on: 10/21/2018. Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default) Metadata: handler_name : ISO Media file produced by Google Inc. Created on: 10/21/2018. At least one output file must be specified
The issue disappears with -analyzeduration 6M
.
by , 6 years ago
Attachment: | movie_cut.mp4 added |
---|
comment:3 by , 6 years ago
Replying to cehoyos:
The issue disappears with
-analyzeduration 6M
.
I have not changed anything. I also do not see the title at the beginning when playing movie.1.mp4.
ffmpeg version N-92868-g51b356eef8
comment:4 by , 16 months ago
I repeated the command given in the first post with ffmpeg version 2023-08-14-git-c704901324-full_build-www.gyan.dev.
I no longer see the error, but the first 1.4 seconds with the video title are still missing in the resulting file.
Here is an example with a non-zero keyed keyframe.
I also noticed that frame 603.480 is in both files (movie.1.mp4 and movie.2.mp4), although the previous frame with time 603.440 is a P-frame. IMHO, it should be the last frame for the movie.1.mp4. I moved the range to "-ss 0.000 -to 603.470", but it did not change anything.