Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6078 closed defect (worksforme)

Duplicate 1st frame

Reported by: sorath Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: mov edts
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
FFmpeg duplicates 1st frame, while "Final Cut Pro", "Adobe Premiere CC", "avconv" display only 1 frame with 00:00:00:00 BITC

How to reproduce:

ffmpeg -i example.mp4 -vframes 10 -report frames%d.png

ffmpeg started on 2017-01-13 at 11:24:09
Report written to "ffmpeg-20170113-112409.log"
ffmpeg version N-83096-g6596b34 Copyright (c) 2000-2017 the FFmpeg developers

built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 43.100 / 55. 43.100
libavcodec 57. 72.100 / 57. 72.100
libavformat 57. 62.100 / 57. 62.100
libavdevice 57. 2.100 / 57. 2.100
libavfilter 6. 69.100 / 6. 69.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'result.mp4':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
creation_time : 2016-12-13T00:01:19.000000Z
encoder : Lavf57.10.2

Duration: 00:00:01.04, start: -0.013061, bitrate: 304 kb/s

Stream #0:0(eng): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 480x270 [SAR 1:1 DAR 16:9], 166 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 24k tbc (default)
Metadata:

creation_time : 2016-12-13T00:01:19.000000Z
handler_name : VideoHandler

Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
Metadata:

creation_time : 2016-12-13T00:01:19.000000Z
handler_name : SoundHandler

Output #0, image2, to 'frames%d.png':

Metadata:

major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf57.62.100
Stream #0:0(eng): Video: png, rgb24, 480x270 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
Metadata:

creation_time : 2016-12-13T00:01:19.000000Z
handler_name : VideoHandler
encoder : Lavc57.72.100 png

Stream mapping:

Stream #0:0 -> #0:0 (mpeg4 (native) -> png (native))

Press [q] to stop, ? for help
frame= 10 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.41 bitrate=N/A dup=1 drop=0 speed=11.7x
video:7kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Attachments (2)

example.mp4 (38.6 KB ) - added by sorath 7 years ago.
example.mp4
ffmpeg-20170113-112409.log (9.2 KB ) - added by sorath 7 years ago.
Report

Download all attachments as: .zip

Change History (11)

by sorath, 7 years ago

Attachment: example.mp4 added

example.mp4

by sorath, 7 years ago

Attachment: ffmpeg-20170113-112409.log added

Report

comment:1 by Carl Eugen Hoyos, 7 years ago

Component: ffmpegundetermined

Do you believe this is a regression?

comment:2 by sorath, 7 years ago

Component: undeterminedffmpeg

comment:3 by Carl Eugen Hoyos, 7 years ago

Component: ffmpegundetermined
Priority: importantnormal

comment:4 by sorath, 7 years ago

I didn't check all older versions, but under some versions it works same way, so don't know if it was fixed ever.

Last edited 7 years ago by sorath (previous) (diff)

comment:5 by Carl Eugen Hoyos, 7 years ago

Resolution: worksforme
Status: newclosed

I don't think there is an issue, the input file has audio starting at pts 0 and video starting later, the first frame has to be duplicated for cfr output.

comment:6 by sorath, 7 years ago

Unfortunately all other video editing tools (avconv, Final Cut Pro, Adobe Premiere CC) do NOT duplicate 1st frame.
I didn't expect fast fix for this bug, but since its an expected behavior and since its unacceptable in my case (need a frame accurate encoding) should move to another library.
Thank you.

comment:7 by Clément Bœsch, 7 years ago

That's probably because they work on a constant frame rate default.

You can use -vsync vfr to copy this behavior with ffmpeg. You will have the frame accuracy, but you will loose the "timings": images don't have timestamps, so it's assuming constant frame rate, and thus has to duplicate to keep playback as correct as possible.

comment:8 by sorath, 7 years ago

Yes, -vsync vfr works like a charm. Thank you a lot.

comment:9 by Carl Eugen Hoyos, 7 years ago

Keywords: mov edts added
Note: See TracTickets for help on using tickets.