Playback Issue on Chrome for Recorded Videos

Taylor

Member
We have just recently experienced a problem where the recorded videos are being played sideways on Chrome.

ChromeIssueExample.png


The latest version of Chrome was released only 2 days ago and it has affected most of our recorded videos done through WCS. It seems unaffected by the device it was recorded on, as Windows-Chrome, iMac-Chrome, iPad Safari, Linux Firefox were all tested.

I have tested recording videos today on our server, WCS 5.2.944, and on Flashphoner's demo server, WCS 5.2.1131, and they both have the video playback sideways. This is also true with old recorded videos done on WCS 5.2.780.

What is weird however is that when I went back as far as WCS 5.2.389 (recorded around early 2020), it seems that the videos are orientated correctly for Chrome.
Also when I run the ffmpeg command to repair the videos, ffmpeg -i video.mp4 repaired_video.mp4, the repaired video plays correctly on Chrome.

I'm unsure why this is the case however since checking Google's support centre doesn't seem to have any issue of the likes reported, nor could I find a pattern from the metadata of the videos.

Any idea as to why this is happening would be greatly appreciated.

Just to reiterate:
  • Recorded videos are being rotated sideways when playing on Chrome browser.
    • It affects Chrome and Edge browsers.
    • Does not affect Firefox or iOS Safari browsers.
    • Does not affect Android Chrome browser (application version was 99.0.4844.88 which was 6 days prior to the latest Chrome update on PCs)
  • Only appeared recently, which we believe is due to latest Chrome version 100.0.4896.75.
  • Only appears to affect videos recorded on WCS.
    • Have check at least 10 different videos sourced outside of WCS and all play correctly.
  • Unaffected by device recorded on, or by orientation of video:
    • Recording on Chrome is in landscape orientation and rotates 90 degrees when playing back on Chrome.
    • Recording on iPad Safari is in portrait orientation and rotates 90 degrees when playing back on Chrome.
  • Affects new and old recorded videos (WCS 5.2.780, 5.2.944, 5.2.1311).
  • Hasn't affected videos recorded on WCS 5.2.389 (was done two years ago, haven't tested on newly deployed server of same version).
  • Running ffmpeg command on video fixes the issue.
Cheers,
Taylor
 

Max

Administrator
Staff member
Good day.
This seems like Chrome bug affecting MP4 metadata parsing, because Firefox, Safari and VLC plays MP4 recording files normally.
But we created a ticket WCS-3465 to check if metadata we writing conforms MP4 container specification. If yes, this is definitely a Chrome bug.
As workaround, use postprocessing with ffmpeg in on_record_hook script.
 

Taylor

Member
Hi Max

Thank you for replying so quickly and creating a ticket to check the metadata.

It seems like it is a Chrome bug as someone else has experienced the same problem and has reported it to Chrome:

I've checked their findings against the videos I've downloaded I've been able to confirm there is a pattern in the metadata as all the videos that have this rotation issue contain:
Code:
Rotation: -9223372036854775808
DisplayMatrix:
00000000:            0           0           0
00000001:            0           0           0
00000002:            0           0           0
While the videos that aren't affected do not have any rotation or display matrix metadata.

I hope this information is helpful, and sorry for initially bothering you since this is a Chrome bug and hopefully they'll fix it as soon as possible.

Cheers,
Taylor
 

Max

Administrator
Staff member
I hope this information is helpful, and sorry for initially bothering you since this is a Chrome bug and hopefully they'll fix it as soon as possible.
Thank you for information. Don't be sorry: we'll investigate at our side why rotation is set in recordings (normally should not because WebRTC orientation extension is disabled by default).
 

Taylor

Member
Hi Max

I would like to confirm and ask a few things:

Firstly I'd like to confirm the meta-data I sent to you is definitely corrupt.
I'm unsure from just reading the rotation value, even though it looks very iffy, but I believe the display matrix to be incorrect since it should conform to this formula:
Screenshot from 2022-04-11 11-11-13.png

But since all values are 0, it's impossible for cos and sin to equal 0 at the same time. Can you confirm I am understanding that correctly?

Secondly with the suggestion of an on_record_hook while it should work for newly recorded videos it still leaves the problem of old videos having the issue.
We record over 2000 videos a day on the WCS servers so applying ffmpeg fix to both old and new videos for a possible issue that only affects Chromium browsers is not ideal, especially if and when Chrome decides to release the fix.

My question is: Do you have a simpler solution?
Our solution is to have a button for our users to rotate the video in the player 90 degrees so that it orientates correctly if they have this issue. We don't wish to dig through the metadata for all the videos since, as I explained above, there's a lot and it is a Chrome bug.

Cheers,
Taylor
 

Max

Administrator
Staff member
Can you confirm I am understanding that correctly?
We'll check it in ticket WCS-3465.
My question is: Do you have a simpler solution?
The Chrome bug is already marked as fixed: https://bugs.chromium.org/p/chromium/issues/detail?id=1313851#c7. Perhaps it will be released soon.
We'll fix orientation value at our side, and the fix will affect a new recordings. For old recordings, there are the only simple solution:
1. Use other browser until Cheome bug fix is released
2. Update Chrome to fix the bug
 

Taylor

Member
Thank you Max

I've noticed that the Chrome bug is marked as fixed and also checked our videos on Chrome Canary (their dev release browser) and have confirmed the latest version does not have the rotation issue.

So now we just wait for stable Chrome release to have it.

Cheers,
Taylor
 

Max

Administrator
Staff member
Good day.
We fixed rotation and display matrix issue in MP4 recordings in WCS build 5.2.1165, so Chrome versions without bug fix should play a new recordings correctly.
For old recordings, waiting for Chrome fix.
 
Top