Ffmpeg - mp4 playing safari if this is not the first source? Chrome will not play the same mp4?

Another issue related to downloading html5 video.

I created 3 versions of the same video in 3 different formats using ffmpeg: mp4, ogg and webm.

.gg plays perfectly in chrome when specified as the first html5 video source, and .mp4 plays perfectly in safari when it is specified as the first html5 video source, however, if I listed the .mp4 source above the .ogg source, chrome will no longer load / play video in .ggg format, since it defaults to a .mp4 video that will not play , and in the same way, if I listed the .ogg source file above the .mp4 source file, safari will not download the .mp4 video.

I'm at a loss. Here is my embed code:

<video width="100%" height="100%"> <source src="./videos/Wildlife.ogg"> <source src="./videos/Wildlife.webm"> <source src="./videos/Wildlife.mp4"> </video> 

Any ideas as to why backups between sources are not working properly?

Why does safari not obey a backup order and ignore .ogg / .webm files?

+1
source share
1 answer

After quite a bit of troubleshooting and adding / removing tags, I finally got backups to work correctly by specifying their types.

 <video width="100%" height="100%"> <source src="./videos/Wildlife.ogg" type="video/ogg"> <source src="./videos/Wildlife.webm" type="video/webm"> <source src="./videos/Wildlife.mp4" type="video/mp4"> </video> 

In other words, in my case, browsers do not depart from the next available (playable) video format unless I add type = attributes for each type of video.

+2
source

Source: https://habr.com/ru/post/1488853/


All Articles