Squeezing the best image quality from a movie file capture device - (repost of a few years ago)
Just some general info;
As it stands the Mapillary tools have a “switch glitch” in the ffmpeg extraction command. It specifies -qscale 1 (same as -q:v 1), but the default action will only allow a minimum value of 2. The switch -qmin 1 fixes this. Warning. Resultant jpg files will be roughly twice the size since they are effectively a higher quality.
Running the ffmpeg command to extract as png rather than jpg is lossless. It is then easy to convert the png’s to jpg’s with something like ImageMagick that has better controls over compression etc. Yet another warning that png files are bigger still.
Depending on your capture device it is possible that the tools output wont contain the higher quality key or index frames. This is more likely to happen when downrating a video FPS. (eg using a 30FPS video to produce 5FPS images)
The above obviously entails modifying the tools, mostly in process_video.py