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.
Download FFmpeg for Windows.
Unzip it to your computer, then enter its /bin folder. You should see a similar folder structure to this:
Insert your original video into this bin folder and rename it to original.mp4:
Create a bat file in this folder. Let's call it encode.bat:
You should write this code into the bat file:
ffmpeg -i original.mp4 -vcodec h264 -an -strict -2 new.mp4
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:
This is the new video, which can be played in most browsers.
There are multiple options offered by FFmpeg to work with your videos.
Resizing the video
The following code resizes the video to 1920*1080px.
ffmpeg -i original.mp4 -vf scale=1920:1080 -vcodec h264 -an -strict -2 new.mp4
First 10 seconds
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