Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two H.264 mp4 videos: One plays in Chrome, one doesn't

I have two different videos, both (as far as I know) generally captured in the same manner, that I'm trying to play using an HTML5 video tag in Chrome. Both videos open and play perfectly in VLC, so I don't think there's any issue with a corrupted file, and both are mp4's with an H.264 format, using YUV color space. However, when I try to play one in Chrome (Version 21.0.1180.89) it gives me a grayed-out play button, while the other works perfectly. For reference, my OS is Ubuntu 10.10, although I've seen the same problem in newer versions of the OS. This is whether I'm loading the video into the HTML5 tag, or navigating directly to the URL where the video is being stored. I'm somewhat at a loss here, does anyone know what direction I should go to find what the significant differences are between the two videos?

Edit:

This one works: https://dl.dropbox.com/u/100841270/1_G101_20120914_0139PM_Course_101.mp4

This one does not: https://dl.dropbox.com/u/100841270/1_G101_20120914_1156AM_Course_101.mp4

Update:

It appears to have nothing to do with OS, since I've seen the same problem in both Windows and Linux. Chrome 22 beta in Ubuntu didn't seem to work either.

like image 654
Jeremy T Avatar asked Sep 14 '12 19:09

Jeremy T


People also ask

Why any video is not playing in Chrome?

Accumulated data in the form of cache and cookies tend to prevent videos from playing on Chrome. Get rid of these corrupted cookies, history, passwords, and any other browsing data, to free up space for new videos to load and play.

Why is my MP4 not playing in HTML?

If your mp4 video does not play in the web browsers and devices, it's probably because the video is not HTML5 compatible. You can view this tutorial to convert the video file to HTML5 compatible: How to convert video to HTML5 compatible.

How do I play local videos on Chrome?

Play local video files within the Google Chrome browser Launch the Chrome browser and set it aside open. 4. Right-click on the video and select “Picture in Picture” (here you need to select the option one time only), minimize Chrome and watch the video on your desktop.


1 Answers

We had this problem and found that encoding the files in accordance with iPhone's webview's standards created files that played fine in Chrome. Chrome and iPhone webview share the same render engine, and it appears they have similar HTML5 video requirements.

Not all H.264 encoded Mp4 files are supported by Chrome and slight differences in the encoding process can produce videos that do not work. Even if the EXACT same encoding settings were used, H.264 is a variable bit-rate encoder, so different videos may exceed bitrate limits.

The encoding settings that were successful for us were:

  • Only use the H.264 Baseline Profile Level 3.0
  • Resolution below 640 x 480 and framerate up to 30 fps
  • B frames are not supported in the Baseline profile.
  • bitrate limit of 900kb.

Here is the reference we used to arrive at those settings. Likely not all of these are required for Chrome, but we stuck to these rules and found that all videos worked on both platforms. Further research could likely determine the exact setting that is/was causing Chrome to not play the video.

like image 194
BishopZ Avatar answered Sep 26 '22 03:09

BishopZ