2

Here is a MOV video file URL which was copied from my iPhone 8.
https://www.yangfamily.tw/attachments/IMG_3049.MOV

Then I tried to play this video on Chrome, the html code like below:

<video width="320" height="240" controls>
  <source src="https://www.yangfamily.tw/attachments/IMG_3049.MOV">
  Your browser does not support the video tag.
</video>

Ok, it was loaded successfully. But no frame showed, only the controls displayed.

And then I right clicked the controls, the menu showed that it is an AUDIO file, not a video file. Right clicked on the controls

It's indeed a video file, and I can play this video file and show the frames successfully on any other player. Why this MOV video file was read as an audio file in Google Chrome? (Chrome Version: 90.0.4430.93 64-bits)

Any idea?

Banana Code
  • 759
  • 1
  • 12
  • 28
  • Set the type for it `type="video/mp4"` [How to open mov format video in HTML video Tag](https://stackoverflow.com/questions/31380695/how-to-open-mov-format-video-in-html-video-tag) – Joshua Ooi May 08 '21 at 09:11
  • Still not work! It still shows controls only. No frame display even set the type `type="video/mp4"`.. – Banana Code May 08 '21 at 09:43
  • [How to play .mov files in video tag](https://stackoverflow.com/questions/40995987/how-to-play-mov-files-in-video-tag/40997241) – Joshua Ooi May 08 '21 at 12:11
  • 1
    _`"...which was copied from my iPhone 8."`_ I checked your file and you have MP4 with H265 video codec _but_ Chrome only supports MP4 with H264 codec. You can download a tool called `MediaInfo` to check (or use a media player shows info about codecs). The video itself must be re-encoded or else just don't use Chrome. I assume Safari decodes H265? – VC.One May 09 '21 at 08:37

2 Answers2

5

This video is encoded as h.265 HEVC.

ffprobe is a free open source tool (online version: https://ffprobe.a.video/probe?url=https%3A%2F%2Fwww.yangfamily.tw%2Fattachments%2FIMG_3049.MOV)

when I look at the codec:

codec_long_name : H.265 / HEVC (High Efficiency Video Coding)

h265 is only supported in Safari. its a patent/royalty thing. You should re-encode the video as h264 - and serve that version (99.9% browser support).

Chrome CAN play the audio track:

codec_long_name : AAC (Advanced Audio Coding)

so thats why you get audio only in Chrome.

szatmary
  • 29,969
  • 8
  • 44
  • 57
Doug Sillars
  • 1,625
  • 5
  • 7
0

In your <source> tag, you need to add type='video/mp4'

Like this:

<source src="https://www.yangfamily.tw/attachments/IMG_3049.MOV" type='video/mp4'>

Dat Boi
  • 595
  • 3
  • 12