Why is my YouTube video distorted on so many mobile devices?

A few hours after I uploaded an FFmpeg-encoded YouTube video, the few people that I had sent it to started reporting a strange issue: that the first 26 minutes of the audio sounded very distorted; some have described it as sounding like it's underwater. Here's an example of what it sounds like.

I then started testing with more people, and came up with the following data from a total of 31 mobile devices.

Normal Audio:

Galaxy S10 (x2)
Galaxy S20 (x3)
Galaxy A50
iPhone XR (x3)
iPhone 7
iPhone 8 (x2)
iPhone 10 Pro
iPhone 11
iPhone 11 Pro
iPhone 11 Pro Max
iPhone 12 (x3)
iPhone 12 Pro
Oppo F11
OnePlus 7T
Pixel 3A XL
OnePlus 7 Pro

Distorted Audio:

iPhone 6S
Galaxy S7 Edge
Galaxy S8+
Galaxy S10 Lite
Huawei Y6 2019
Huawei P30 Pro
Honor 10 Lite

The audio for those first 26 minutes is broken for 7 out of 31 mobile devices, so 22%, and this increases to more than 50% when only Android phones are included. Most of those I asked were based in developed countries, which means that the data also skews towards newer, more modern phones, which means that figure could easily be closer to 80% in less developed countries that primarily use older Androids.

Needless to say, this is a pretty big problem for someone like me who expected to be able to upload to YouTube and let it handle the rest instead of doing web-dev-like device debugging.

I compiled the video from several source videos, encoding and concatenating them using FFmpeg.

It uses H264 and OPUS as codecs, but more relevantly, checking the source video that those first 26 minutes comes from shows that this problem originates in that video, so now the question becomes:

a) What is it in that particular source video that is causing the audio to become garbled in such a large proportion of mobile devices?

b) How can I fix it using FFmpeg?

14

1 Answer

I have no idea why this was downvoted, but regardless, I managed to find a fix for the problem by posting the exact same question to the Doom9 audio specialists forum. I got the following response almost immediately from the user lvqcl:

Left and right channels are 180° out of phase. Invert one of them (the first 26 minutes of one of the channels, that is).

When I asked him why the problem was limited to certain mobile devices, he responded:

It seems that they play audio in mono, so they add left and right channels together. So the result contains only audio compression artifacts from left and right channels.

I then set about searching how to fix this in FFmpeg and came across the following command, courtesy of Gyan here:

ffmpeg -i input.wav -af "aeval='-val(0)':c=same" output.wav

Running this command on the source video in question, re-concatenating all the source videos, re-uploading to YouTube, and then testing again with the same devices, confirms that this has indeed fixed the issue.

I was glad to be able to upload my video to YouTube without worrying about individual device support, having dealt with that enough in my web development work. Thanks to everyone who voted to keep this question open against the wishes of this site's increasingly overzealous moderators.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like