I want to convert from .flv
to .h264
format.
Problem: I did a conversion from FLV to H264 format but my converted video (.h264) is running so fast (just like we'd click on a fast forward button).
I used the following command:
ffmpeg -i example.flv -sameq -vcodec libx264 -vpre default -ar 22050 output.h264
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.
x264 is a free software library and application for encoding video streams into the H. 264/MPEG-4 AVC compression format, and is released under the terms of the GNU GPL. Download x264 master • Source • 750kB. Binaries.
The solution is that you need a container format. Raw h.264 does not have any timing information for a video which is why your player is playing it very fast.
Also your command is all messed up. Do you want audio in your output or not? If yes then you need to specify a container format which will have both audio and video.
Either change your output to a mp4
ffmpeg -i input_file -c:a copy -c:v libx264 -profile:v baseline out.mp4
or some other container. If you want a video only stream remove the audio options and add -an
.
If you want to use AAC audio instead of whatever the FLV file has:
ffmpeg -i input_file -c:a aac -strict -2 -b:a 128k -c:v libx264 -profile:v baseline out.mp4
If your ffmpeg does not have the -c
or -profile
options, update to a more recent version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With