Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FFmpeg command with -ss option fails on .flv files

Tags:

ffmpeg

I am using FFmpeg to extract screenshot from a video with the following command

/usr/bin/ffmpeg -ss 15 -y -i test.flv -vcodec mjpeg -vframes 1 -an -f rawvideo test.png

But the command fails. Last 3 lines of the response are

frame=    0 fps=  0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=   0.0kbits/s
video:0kB audio:0kB global headers:0kB muxing overhead -nan%
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Note that command runs successfully for other video types (3gp, mp4).

Also, when I replace "-ss 15" option with "itsoffset 15" it runs successfully with flv files as well.

Does anybody know why -ss option doesn't work for .flv files?

like image 898
Hovhannes Nurijanyan Avatar asked Jan 08 '13 08:01

Hovhannes Nurijanyan


People also ask

Does FFmpeg support FLV?

FFmpeg is a command line based tools which allows to do very neat video manipulations. We would like to share this small script, which our IT specialists have used for one of our video conversion projects. It parses a directory, finds all flv (Flash video) files and converts them to mp4.

How do I specify codec in FFmpeg?

You can select the codecs needed by using the -c flag. This will make a Matroska container with a VP9 video stream and a Vorbis audio stream, essentially the same as the WebM we made earlier. The command ffmpeg -codecs will print every codec FFmpeg knows about.


2 Answers

In newer versions of ffmpeg the -ss and -t options must go after -i [filename].

like image 111
Soheil Avatar answered Sep 22 '22 05:09

Soheil


It might be a syntax issue. The following should work just fine:

/usr/bin/ffmpeg -ss 15 -y -i test.flv -frames:v 1 -an test.png

Notice i removed the codec and the format parameters. I don't think it's wise to force mjpeg on a png continuer & flv is not a rawvideo format

like image 44
EladG Avatar answered Sep 21 '22 05:09

EladG