If the parameter faststart is used, the moov will be moved to the front of mdat after the above structure is generated:
ffmpeg –i input.flv –c copy –f mp4 –movflags faststart output.mp4 Then use mp4info to view the container order of mp4, you can see moov was moved to the front of mdat,
Refer to the figure below for comparison (the tool uses mp4info):
Before parameter optimization: After parameter optimization:
After the moov is pre-positioned, if the video is played through the browser, the player does not have to wait until the entire video is loaded before starting to play, thereby accelerating the online playback speed and reducing the waiting time for video download and loading.
Optimize the loading speed of mp4 video in html