MP4 does not show video

Asked

Viewed 2,545 times

1

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

<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>

inserir a descrição da imagem aqui

  • Does an error appear on the console? The site server has mime type mp4?

  • Hello Caique. How can I check this? It would be directly with them or have some command I can do this check?

  • No errors appear, you can only hear the sound of the video, but the image does not appear.

  • Then I’m not sure rsrsrsrs

  • How can I verify that this train is H.264?

  • I’m using Linux Deepin

  • The customer sent us this video and came to us with the MP4 extension. I didn’t know it had this difference.

  • Thank you William.

  • If it makes it easier, we have another Windows computer.

Show 4 more comments

1 answer

3


Extensions in files like .mp4 or .webm do not guarantee that the format in fact is what it indicates, something else the extension .mp4 can refer to different video formats (encodings), in Chrome and Firefox 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 its 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 internally I believe uses the Part 10 (cannot accurately state) and may not work well on Chrome, but work well on browsers that use Codecs installed on the operating system.

To know what 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 the mouse/mouse in the video, select information:

info

And go to the CODEC tab:

codec

In my case appeared VC1 which is another codec format, it is just to illustrate, if it is a MP4 video in fact will appear something like this:

h264

If it did not appear H264 (part 10) then it is because MP4 format is not supported by browser, or it is not even mp4

Now if you show H264 normally then it may be a problem on your computer (you can’t be sure), if you are using Chromium and not Chrome then it may be the problem, because Chromium does not natively support H.264, depends on whether you have installed Codecs on the machine and/or FFMPEG

How to convert to MP4 (H264)

To convert H264 you can install the FFMPEG, can download on the link:

https://www.ffmpeg.org/download.html

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
  • Show ball William. I will download the VLC and follow the steps informed. Thank you very much.

  • I printed the result and changed my post. It is MP4, but it does not appear as the image you showed.

  • @Fox.11 to convert installs the FFMPEG and uses the command like this ffmpeg -i o-video.mp4 -vcodec mpeg4 -acodec aac novo-video.mp4

  • Right William. I’ll do it. Thank you again.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.