MP4 video does not appear

0

We want to include an MP4 video in the site through the command below, but only the sound and not the video, but if it runs directly on the computer, the video appears. We are using the 64-bit Chrome Version 62.0.3202.62 (Official Version) browsers and the Firefox Quantum 57.0b14 (64bits):

<video width="520" height="440" controls>
 <source src="o-video.mp4" type="video/mp4">
 Seu navegador não dá suporte a HTML5. Favor atualizar seu navegador.
</video>

    
asked by anonymous 13.11.2017 / 20:31

1 answer

2

Extensions to files such as .mp4 or .webm do not guarantee that the actual format is what it says, else the .mp4 extension can refer to different video formats (encodings), in Chrome and Firefox the mp4 is the format:

  

H.264 / MPEG-4 AVC

Chrome, unlike other browsers, has its own decoders, with support for:

  • Theora
  • H.264 (MP4)
  • VP8 (WebM)
  • VP9 (WebM)

If the video you received is not H.264, then probably only the audio is supported.

Note that h.264 is known as MPEG-4 Part 10 , however there is another format called MPEG-4 Part 14 , which I believe internally uses Part 10 (I can not state with precision) and may not work well in Chrome, but work fine on browsers that use the CODECs installed on the operating system.

To find out the actual format of the video, you can install programs like:

VLC

Open the video in the player, go to the playlist and right-click on the video, select information:

AndgototheCODECtab:

InmycaseitappearedVC1whichisanothercodecformat,it'sjusttoillustrate,ifit'sanMP4videoitwillactuallyappearsomethinglikethis:

IfH264(part10)didnotappearthenitisbecausetheMP4formatisnotsupportedbythebrowser,orevenmp4

NowifyoushowH264normallythenitcouldbeaproblemonyourcomputer(youcannotbesure),ifyou'reusingChromiumandnotChromethenthatmightbetheproblembecauseChromiumdoesnotnativelysupportH.264,dependsonhavinginstalledCODECsonthemachineand/orFFMPEG

HowtoconverttoMP4(H264)

ToconverttoH264youcaninstallFFMPEG,youcandownloadthelink:

  

link

After installing use via command line like this:

ffmpeg -i o-video.mp4 -vcodec mpeg4 -acodec aac novo-video.mp4
  • The o-video.mp4 is the current video
  • The novo-video.mp4 will be the converted video
13.11.2017 / 21:08