[FFmpeg-user] Selecting/dropping frames without re-encoding

Mikhail V mikhailwas at gmail.com
Mon Oct 10 22:12:48 EEST 2016


On 8 October 2016 at 00:31, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 2016-10-08 0:01 GMT+02:00 Mikhail V <mikhailwas at gmail.com>:
>> BTW after that manipulations a fair question arizes: why
>> ffmpeg does not support something like:
>>  "... -f image2 -i filelist.txt output"
>
> (This command tries to read a frame / imagefile called filelist.txt)
> It does, it is called -f concat and is just an alternative of your
> python script.
>
> Carl Eugen

Hi again.
Since you say that "-f concat" should work same as -f image2 to create
video from images,
probably you can pour some light on what I am doing wrong then.
Note that ideally I need an MOV file because Sony Vegas cannot open MXF files
 for some reason so MOV container is preferred.
So I have a file "concat.txt" in my case it holds following data:

file 'frame0001'
file 'frame0003'
file 'frame0005'
file 'frame0007'
file 'frame0009'
file 'frame0011'
....

So it is simply a list of odd frames  generated by my script.
Now to create a MXF I use this command:

$ffmpeg -f concat -r 25 -i concat.txt -vcodec copy out.mxf

Which is probably not correct?  but I don't know exact right command.
The result seems correct BUT ffmpeg spits out errors on each frame
(here is only last part of the output):

....

[mxf @ 0000028f2461b200] Application provided invalid, non
monotonically increasing dts to muxer in stream 0: 1 >= 0
    Last message repeated 62 times
frame=  813 fps= 46 q=-1.0 size=  365042kB time=00:00:00.08
bitrate=37380251.6kbits/s
[mxf @ 0000028f2461b200] Application provided invalid, non
monotonically increasing dts to muxer in stream 0: 1 >= 0
    Last message repeated 140 times
frame=  954 fps= 52 q=-1.0 size=  428351kB time=00:00:00.08
bitrate=43863093.2kbits/s
[mxf @ 0000028f2461b200] Application provided invalid, non
monotonically increasing dts to muxer in stream 0: 1 >= 0
    Last message repeated 138 times
frame= 1093 fps= 58 q=-1.0 size=  490762kB time=00:00:00.08
bitrate=50253979.6kbits/s
[mxf @ 0000028f2461b200] Application provided invalid, non
monotonically increasing dts to muxer in stream 0: 1 >= 0
    Last message repeated 142 times
frame= 1236 fps= 64 q=-1.0 size=  554969kB time=00:00:00.08
bitrate=56828776.4kbits/s
 [mxf @ 0000028f2461b200] Application provided invalid, non
monotonically increasing dts to muxer in stream 0: 1 >= 0
    Last message repeated 142 times
frame= 1379 fps= 70 q=-1.0 size=  619176kB time=00:00:00.08
bitrate=63403573.2kbits/s
 [mxf @ 0000028f2461b200] Application provided invalid, non
monotonically increasing dts to muxer in stream 0: 1 >= 0
    Last message repeated 120 times
frame= 1500 fps= 74 q=-1.0 Lsize=  673506kB time=00:00:00.08
bitrate=68966967.7kbits/s speed=0.00395x
video:672000kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.224039%


As said the resulting file is correct, but what does these errors mean
I am not sure.
Anyway if I use -f image2 to generate a same video no errors appear -
how is that?
What is correct command then for concat if I am doing it wrong?

Now the same command for mov container. MOV is also valid for DNxHD codec and
 actually is preferred in my case since MXF files cannot be opened by
Sony Vegas.

$ffmpeg -f concat -r 25 -i concat.txt -vcodec copy out.mxf

And the output (last part of it, since it also spits out errors on each frame):

[mov @ 0000014afd95b200] Non-monotonous DTS in output stream 0:0;
previous: 1258, current: 0; changing to 1259. This may result in
incorrect timestamps in the output file.
[mov @ 0000014afd95b200] Non-monotonous DTS in output stream 0:0;
previous: 1259, current: 512; changing to 1260. This may result in
incorrect timestamps in the output file.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000014aff2a0420] moov atom not found
[concat @ 0000014afd956640] Impossible to open 'out.mov'
concat.txt: Invalid data found when processing input
frame=  750 fps= 43 q=-1.0 Lsize=  336002kB time=00:00:00.13
bitrate=19882772.1kbits/s speed=0.00788x
video:336000kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.000698%

In this case it produces a file but it is _incorrect_
See FFPROBE for mov file - fps is nonsense:

$ffprobe out.mov

ffprobe version N-79107-g30d1213 Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-iconv --enable-libass --enable-libbluray
--enable-libbs2b --enable-libcaca --enable-libdcadec
--enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc
--enable-libmodplug --enable-libmfx --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinger --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. 19.100 / 55. 19.100
  libavcodec     57. 28.103 / 57. 28.103
  libavformat    57. 29.100 / 57. 29.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mov':
  Metadata:
    major_brand     : qt
    minor_version   : 512
    compatible_brands: qt
    encoder         : Lavf57.29.100
  Duration: 00:00:00.14, start: 0.000000, bitrate: 19802382 kb/s
    Stream #0:0(eng): Video: dnxhd (AVdn / 0x6E645641),
yuv422p10le(tv, bt709/unknown/unknown), 1280x720, 27939852 kb/s,
7613.01 fps, 12800 tbr, 12800 tbn, 12800 tbc (default)
    Metadata:
      handler_name    : DataHandler



So how would I do it with a file list and concat so it does not give
me errors and produces correct MOV file?


More information about the ffmpeg-user mailing list