1

According to this article I used successfully the command

$ ffmpeg -vf "select='eq(pict_type,I)'" -i somevideo.mp4 -vsync 0 -f image2 /tmp/thumbnails-%02d.jpg

I tried the second command:

$ ffmpeg -vf "select='gt(scene\,0.9)'" -i somevideo.mp4 -vsync 0 -f image2 /tmp/thumbnails-%02d.jpg

but ended with error:

Undefined constant or missing '(' in 'scene'

Because

$ ffmpeg -version
ffmpeg version 0.8.17-4:0.8.17-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Mar 16 2015 13:28:23 with gcc 4.6.3
The ffmpeg program is only provided for script compatibility and will be removed
in a future release. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
ffmpeg 0.8.17-4:0.8.17-0ubuntu0.12.04.1
libavutil    51. 22. 3 / 51. 22. 3
libavcodec   53. 35. 0 / 53. 35. 0
libavformat  53. 21. 1 / 53. 21. 1
libavdevice  53.  2. 0 / 53.  2. 0
libavfilter   2. 15. 0 /  2. 15. 0
libswscale    2.  1. 0 /  2.  1. 0
libpostproc  52.  0. 0 / 52.  0. 0

I tried to use rather avconv. It runs both commands successfully, but in both cases it generates incorrect results (too many frames, so seemingly ignoring the video filter expression).

How can I correct my ffmpeg or avconv to give the right results?

1
+200

First of all, -vf needs to be specified after the input in order to affect it, and it seems to be the only reason avconv worked for the second command: it must have discarded your filter without even parsing it. If you move the argument after -i, it will result in the same error as ffmpeg gave you. Newer versions of ffmpeg actually treat that as an error.

Now the reason why neither of the commands are working is simple: neither of the versions that you are using support the scene filter. What's more, the scene filter still appears to be missing in the master branch of avconv as of now, thus, avconv simply does not support it. As for ffmpeg, the filter was introduced in r7286814 which didn't make it into your build.

Hence, you need to obtain an up-to-date version if you want to use the filter.

Once installed, move -vf after -i, and run your command to get your results.

$ ffmpeg -i somevideo.mp4  -vf "select='gt(scene,0.9)'" -vsync 0 -f image2 /tmp/thumbnails-%02d.jpg
  • OK, I see you figured out where was the problem. I have to travel tommorrow, so I will accept it. Though I'm not sure if it will work (no other problem will occur) after ffmpeg compilation which is slow and I have to sleep. – xralf Mar 1 '17 at 0:26
  • I don't care whether you accept it or not tbh. Do it only if works for you. I just try to answer questions about ffmpeg that I see since it's my area of interest. By the way, you don't have to compile it, the download page that I linked references a repo with up-to-date builds. – undercat supports Monica Mar 1 '17 at 1:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.