[FFmpeg-user] copy codec doubles frame rate (was: Pipe concat doubles frame rate)
Joel Roth
joelz at pobox.com
Wed Feb 21 22:35:20 EET 2018
Joel Roth wrote:
> Joel Roth wrote:
> > Following up my own post.
> >
> > Joel Roth wrote:
> > > Hi list,
> > >
> > > First of all, thanks to the ffmpeg developers and community
> > > for this awesome software.
> > >
> > > I'm using a two-pass workflow, where I pipe concatenate
> > > source files in the first pass, then trim and process the
> > > result in a second pass. I am not changing framerates.
> > >
> > > Quoting from https://video.stackexchange.com/questions/20958/ffmpeg-dropping-duplicate-frames
> > >
> > > FFmpeg duplicates or drops frames when the input and output framerates differ.
> > >
> > > If I apply an ffmpeg command line to process a raw MTS file
> > > from a camera, I do not get "More than 1000 frames duplicated"
> > > warnings during processing.
> > >
> > > However if I combine MTS files using pipe concatenation,
> > > e.g.
> > >
> > > ffmpeg -i concat:"./00000.MTS|./00001.MTS" -codec copy ./00000.mp4
> > >
> > > then run the same command line on the mp4 result, I get
> > > plentiful duplicate frame warnings.
> > >
> > > I'm using Jon Van Sickle's statically ffmpeg, to wit, ffmpeg-git-20180216-64bit-static/ffmpeg
> > > from https://www.johnvansickle.com/ffmpeg/
> > >
> > > The command line is:
> > >
> > > ffmpeg -i ./00000.mp4 -to 3:31 -c:v libx264 -preset:v medium -profile:v main -tune:v film -s:v 640x360 -c:a aac -b:a 80k -ac 2 -ar 24000 -level 3 -strict -2 -copyts -ss 1:29 ../final/20180220-1.mp4
> >
> > According to ffprobe, the frame rate of the pipe-concatenated video is double.
> >
> >
> > ffprobe version N-45077-g8a8d0b319-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2007-2018 the FFmpeg developers
> > built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
> > configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
> > libavutil 56. 7.101 / 56. 7.101
> > libavcodec 58. 11.101 / 58. 11.101
> > libavformat 58. 9.100 / 58. 9.100
> > libavdevice 58. 1.100 / 58. 1.100
> > libavfilter 7. 12.100 / 7. 12.100
> > libswscale 5. 0.101 / 5. 0.101
> > libswresample 3. 0.101 / 3. 0.101
> > libpostproc 55. 0.100 / 55. 0.100
> > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '00000.mp4':
> > Metadata:
> > major_brand : isom
> > minor_version : 512
> > compatible_brands: isomiso2avc1mp41
> > encoder : Lavf58.9.100
> > Duration: 00:58:26.02, start: 0.000000, bitrate: 6903 kb/s
> > Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1440x1080 [SAR 4:3 DAR 16:9], 6637 kb/s, 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc (default)
> > Metadata:
> > handler_name : VideoHandler
> > Stream #0:1(und): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s (default)
> > Metadata:
> > handler_name : SoundHandler
> > Side data:
> > audio service type: main
> > /mnt/ba1/buenos-aires-1/20180220/raw $ ffprobe *0.MTS
> > ffprobe version N-45077-g8a8d0b319-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2007-2018 the FFmpeg developers
> > built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
> > configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
> > libavutil 56. 7.101 / 56. 7.101
> > libavcodec 58. 11.101 / 58. 11.101
> > libavformat 58. 9.100 / 58. 9.100
> > libavdevice 58. 1.100 / 58. 1.100
> > libavfilter 7. 12.100 / 7. 12.100
> > libswscale 5. 0.101 / 5. 0.101
> > libswresample 3. 0.101 / 3. 0.101
> > libpostproc 55. 0.100 / 55. 0.100
> > Input #0, mpegts, from '00000.MTS':
> > Duration: 00:37:25.73, start: 0.800300, bitrate: 7279 kb/s
> > Program 1
> > Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(top first), 1440x1080 [SAR 4:3 DAR 16:9], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
> > Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
> >
>
> By adding the -r argument with the correct frame rate in the
> second pass, I avoid the duplicate frame warnings.
>
> The doubled frame rate using pipe concat appears to be a
> bug.
If a bug, it would be in the copy codec.
Thanks for listening!
--
Joel Roth
More information about the ffmpeg-user
mailing list