Shishir Mudliyar
Shishir Mudliyar

Reputation: 175

How to convert .flv video into .h264 format with FFmpeg?

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

Upvotes: 5

Views: 14794

Answers (2)

av501
av501

Reputation: 6739

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.

Upvotes: 13

seba.wagner
seba.wagner

Reputation: 3870

The magic key word you are looking for is "frames per second".

Add and " -r 30" for 30 fps in the output video for example.

Sebastian

Upvotes: -2

Related Questions