+2 votes
by
Good afternoon!

I'm trying to put a video on an html page. Tried several variants. But there are several problems:
1. the video file is on the same server as the html file, and it cannot be placed on any streaming servers like youtube
2. Files of 100-250 megabytes in size

Connecting with the native video tag and using the player
Here is the code using the player
<body>
<video
id="my-video"
class="video-js"
controls
preload="auto"
width="640"
height="264"
poster="MY_VIDEO_POSTER.jpg"
data-setup="{}"
>
<source src="../uploads/ca26ad77f5ed42939889819f54fa65d5.m4v" type="video/mp4" />

<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a
web browser that
<a href="https://videojs.com/html5-video-support/" target="_blank"
>supports HTML5 video</a
>
</p>
</video>

<script src="https://vjs.zencdn.net/7.8.3/video.js"></script>
</body>
The video runs only after it is completely loaded into memory on the local computer, and it takes 3-4 minutes to wait. How can this problem be solved ?

2 Answers

0 votes
by
Yes, you must use -movflags +faststart when creating the video file.
Moves some data to the beginning of the file, allowing the video to be played before it is completely downloaded.
https://ffmpeg.org/ffmpeg-formats.html

The syntax goes something like this:
ffmpeg -i in.mp4 -c copy -movflags +faststart out.mp4

Also see, for example, it's .
0 votes
by
Get your streaming server up and running.
As a module for nginx, or some of the of these
...