I tested a ffmpeg command to generate thumbnail ffmpeg -y -ss 0 -to 10 -i acb.mp4 -qscale:v 2 -frames:v 1 abc.jpeg
on macOS and it worked fine , whereas it gave error for the same command on ubuntu 18.04.2(AWS EC2) for ffmpeg.
error :
Option to (record or transcode stop time) cannot be applied to input url abc.mp4 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file abc.mp4.
Error opening input files: Invalid argument
I am using AWS EC2 (ubuntu 18.04.2) , used sudo apt install ffmpeg. Can someone please help me with this , if I have to install it in a different way, or if I am missing something here. Thanks in Advance.
Remove
-to 10
-to
. A single image has no duration so-to
is ignored anyway.-ss
(start time offset) with a value of0
is doing nothing, so you can remove that too.Example:
Same as above but gets a screenshot at 30 seconds:
Get a screenshot at 22 hours 15 minutes 5 seconds but output lower quality:
You can use the alias
-q:v
instead of-qscale:v
if you want.Why it works in macOS and not Ubuntu
The
-to
option was previously only an output option. It has been updated to also work as an input file (declared before-i
). You are using FFmpeg 3.4.6 which is too old to use-to
as an input option. Your FFmpeg version on macOS is new enough that it can use-to
as an input option. But as mentioned previously, when outputting a single image-to
does nothing and is ignored.Also see
ffmpeg