How to encode your video to a format, that can be played by most browsers?

You can use ffmpeg to encode your videos correctly. In this example the original video format is mp4, but it could be a different file format too.

Please note, that we do not support video encoding issues and questions! This documentation was made to try to help out, but any problem related to your video encoding has to be resolved by you!

Step 1

Download ffmpeg.

Step 2

Unzip it to your computer, then enter its /bin folder. You should see a similar folder structure to this:

C:/ffmpeg[build details]/bin/

Step 3

Insert your original video into this bin folder and rename it to original.mp4:

C:/ffmpeg[build details]/bin/original.mp4

Step 4

Create a bat file in this folder. Let's call it encode.bat:

C:/ffmpeg[build details]/bin/encode.bat

Step 5

You should write this code into the bat file:

ffmpeg -i original.mp4 -vcodec h264 -an -strict -2 new.mp4

Step 6

Run the bat file. It should start running the code you entered. After it is done, a new.mp4 file should appear in your folder:

C:/ffmpeg[build details]/bin/new.mp4

This is the new video, which can be played in most browsers.

Additional options

There are multiple options offered by ffmpeg. For example you could resize your video to 1920*1080px too:

ffmpeg -i original.mp4 -vf scale=1920:1080 -vcodec h264 -an -strict -2 new.mp4

Cut out the first 10 seconds, next to this resizing ( -ss is the start, -t is the end time in seconds):

ffmpeg -ss 0 -i original.mp4 -vf scale=1920:1080 -t 10 -vcodec h264 -an -strict -2 new.mp4

Create an image from the first frame:

ffmpeg -i original.mp4 -vf scale=1920:1080 -vframes 1 firstframe.jpg
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.