mastodon / mastodon

Your self-hosted, globally interconnected microblogging community
https://joinmastodon.org
GNU Affero General Public License v3.0
46.81k stars 6.91k forks source link

MP4 not playing video in browsers #8562

Closed Heiwajima closed 8 months ago

Heiwajima commented 6 years ago

2.5.0rc1 and 2.5.0rc2

In web browsers, uploaded mp4 files are not showing video content. Audio content is playing, but only first image of mp4 is showing. Two different videos from different devices (not Apple) I uploaded

See thread https://vcity.network/@c1t7/100653820603304731

Thread above was from both before and after upgrading to 2.5.0rc2 from 2.5.0rc1.

Uploaded gif images played normally.

Both mp4 and gif video played normally on Subway Tooter for Android

Opening post in browser and downloading mp4 displayed video in VLC.

Opening video URL in new browser window had same issue in chrome

Pasting video URL in Firefox failed to display video.

Issue was detected on Ubuntu 17.10 on Chrome/Firefox/Opera Verified on Win10 Chrome and Android 7.0 Chrome KDE Neon with current Firefox

gemlog@mastodonten.de and djsundog@toot-lab.reclaim.technology verified videos were not loading in browsers.


C1T7 commented 6 years ago

Investigating issue for Heiwajima as the report is from vcity.network where they reside.

vcity is on Ubuntu 16.04. Checked with admins of other instances who are upgraded to one of the 2.5.0rc and found issue does not happen for those on 18.10.

  1. Uploaded mp4 that my system could run in browser to vcity. mp4 could not be viewed. Opened in browser. Could not be viewed. Attempted to open from media link. Could not be viewed. Downloaded to laptop. Could be viewed in browser.

  2. Downloaded gif from instance. Instance had converted to MP4. MP4 played in browser before and after download. Uploaded to instance. MP4 could be viewed from web interface.

Was there a change in image handling that affects instances on Ubuntu 16.04? Is there a workaround I could apply to have MP4's modified by the instance while retaining their audio? This might fix the issue.

nightpool commented 6 years ago

I'm assuming this is just an issue with the specific video file?

On Sun, Sep 2, 2018, 1:22 PM C1T7 notifications@github.com wrote:

Investigating issue for Heiwajima as the report is from vcity.network where they reside.

vcity is on Ubuntu 16.04. Checked with admins of other instances who are upgraded to one of the 2.5.0rc and found issue does not happen for those on 18.10.

1.

Uploaded mp4 that my system could run in browser to vcity. mp4 could not be viewed. Opened in browser. Could not be viewed. Attempted to open from media link. Could not be viewed. Downloaded to laptop. Could be viewed in browser. 2.

Downloaded gif from instance. Instance had converted to MP4. MP4 played in browser before and after download. Uploaded to instance. MP4 could be viewed from web interface.

Was there a change in image handling that affects instances on Ubuntu 16.04? Is there a workaround I could apply to have MP4's modified by the instance while retaining their audio? This might fix the issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tootsuite/mastodon/issues/8562#issuecomment-417945757, or mute the thread https://github.com/notifications/unsubscribe-auth/AAORVx5khDXPYv5XV1pPiRmg-iOcCPlBks5uXBPRgaJpZM4WWcl9 .

Heiwajima commented 6 years ago

Issue has been recreated with multiple video files from different sources.

C1T7 commented 6 years ago

Additional testing after upgrade to Ubuntu 18.04 and updating instance in case of dependency changes related to the upgrade has same issue playing mp4 files.

Error was made in test 1 above -- video would not play in browser before upgrade

ran following conversion on file:

ffmpeg -i original.mp4 -pix_fmt yuv420p -crf 18 new.mp4

allowed mp4 to be viewable in browser on system before upload. Posted to vcity and mp4 played in browser after upload.

Issue appears to be related to how browsers handle mp4 playback.

Would there be a way to make it so the instance applied the -pix fmt yuv420p -crt 18 to all mp4 videos at time of upload?

C1T7 commented 6 years ago

Replaced app/models/media_attachment.rb with version from glitch-soc. All videos working as designed.

MightyPork commented 5 years ago

Got a similar issue

Media resource https://cdn-assets.vulpine.owogroupllc.com/media_attachments/files/001/684/946/original/1ba4b26adcf00429.mp4 could not be decoded. 101492886595034350
Media resource https://cdn-assets.vulpine.owogroupllc.com/media_attachments/files/001/684/946/original/1ba4b26adcf00429.mp4 could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_FATAL_ERR (0x806e0005)
Details: auto mozilla::SupportChecker::AddMediaFormatChecker(const mozilla::TrackInfo &)::(anonymous class)::operator()() const: Decoder may not have the capability to handle the requested video format with YUV444 chroma subsampling.

works in chrome, not in firefox (on linux, if that matters), tusky, some mobile browsers. YUV444 seems to be a problem

see https://vulpine.club/users/Triplefox/statuses/101492886595034350