Log in | Register
Forum > Site Discussion > Thread

Video codecs?

Jul 15, 2019 - permalink
(This is mainly directed at Chainer, but anyone else who knows is welcome to respond)

I'm just wondering what video codecs are supported on the site.  I know any videos uploaded have to be in .mp4 format, but there are a number of codecs that can be used with that.  Is it only H.264?  If so I guess that's understandable, since the site (thankfully) doesn't re-encode the videos and you would want to keep wide compatibility with different browsers.

The thing that brought this up is that Youtube sometimes has better resolutions available using the (Google-developed) VP9 codec than any other versions.  I can copy the a/v streams to a .mp4 container easily enough, but GWM just doesn't accept the VP9 codec on upload (it reads it as a bad mp4 file).  I also tested converting one to the H.265 codec, which the site seems to allow for upload, but probably shouldn't as I found out neither browser I use is actually able to play those back.
chevron
Jul 15, 2019 - permalink
Dunno if this is strictly relevant, but some of Chipperpip's Monika Svobodova clips are refusing to load for me and displaying an 'Error' message in the bottom bar ...
Chainer
Jul 16, 2019 - permalink
Interesting, so would that basically be a different filetype?

I'm open to adding support for new formats as long as:

- Browsers can play them back without the site having to re-encode
- ffmpeg can be used to take screenshots
Aug 04, 2019 - permalink
Sorry it took me a while to get back to this.  It would technically be the same filetype, but .mp4 is a container format, which several different audio/video codecs can be used with (H.264 is just the most common one for video).  Allowing VP9-encoded .mp4's also would be nice, but looking up a chart it seems that would lose Internet Explorer and Safari compatibility, so it's probably not doable (Youtube automatically switches between encoded versions depending on the browser to get around that).

chevron, can you point me to a specific video that's not playing for you and tell me what browser you're using?  I'm guessing it'll be one of the clips I converted from Youtube, but those should be standard H.264 mp4's at this point, which nearly everything supports.
chevron
Aug 04, 2019 - permalink
Here's one -- still not loading:
" class="bbc_link" target="_blank" rel="noopener noreferrer">


And another:
" class="bbc_link" target="_blank" rel="noopener noreferrer">


And a third:
" class="bbc_link" target="_blank" rel="noopener noreferrer">


There may be more, but those were the first three I found.

(I'm using Safari 10.1.2 on a 2014 MacPro running OS X Yosemite 10.10.5.)
Chainer
Aug 04, 2019 - permalink
Interesting. The site doesn't do any explicit checks for codecs when processing an uploaded video. It does do an explicit check that the file is an MP4 using libmagic. If this passes then it tries to generate a screenshot using ffmpeg. You said that GWM doesn't accept VP9 encoded videos, so I wonder which of these steps it fails. If you can provide me with a sample video I can investigate more.

I tried using ffmpeg to print out info about one of the videos Chevron says isn't playing, and I got:

Could not find codec parameters for stream 1 (Audio: none (Opus / 0x7375704F), 48000 Hz, 2 channels, 89 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'monika.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.20.100
  Duration: 00:00:42.90, start: 0.000000, bitrate: 3575 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 810x1440 [SAR 1:1 DAR 9:16], 3480 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: none (Opus / 0x7375704F), 48000 Hz, 2 channels, 89 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

For comparison, here's the output for another random video (
" class="bbc_link" target="_blank" rel="noopener noreferrer">this one):

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1216057.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.40.101
  Duration: 00:00:40.29, start: 0.000000, bitrate: 835 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 480x600, 767 kb/s, 29.89 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

I see h264 under both, and I don't know enough about videos to tell which of the differences are relevant. I don't have access to any Apple devices to test playback.

Edit: after trying multiple videos and doing some googling, it's likely that the difference is the h264 profile.  Chipperpip's videos are all High, whereas every other video I've tried is Constrained Baseline or Main.

Solutions to this would be:
- Leave things as is, accept that some videos can't be played back on some devices ¯\_(ツ)_/¯
- Re-encode High videos to use the Constrained Baseline profile
- Reject High videos on upload (maybe re-encode the existing ones)
Aug 05, 2019 - permalink
You said that GWM doesn't accept VP9 encoded videos, so I wonder which of these steps it fails. If you can provide me with a sample video I can investigate more.

Sure, here's an example of one:  https://www.solidfiles.com/v/mXgza24zvAP65
Also, here's the original .webm container file that was downloaded from Youtube before being reformatted into an mp4:  https://www.solidfiles.com/v/yR3X2yzVMwxme

Honestly, I don't think VP9 support is worth bothering with now that I know it would break playback on IE & Safari.  The alternate H.264 encodes are easy enough to download from Youtube for most videos, they're just sometimes lower quality than the VP9 streams.


The H.264 profile issue is more concerning, although now I'm remembering that I think I had to use the "-strict experimental" flag with FFMPEG to get those clips to convert properly, which is probably what led to the nonstandard profile.  I'll probably just replace those versions with a standard mp4 download from Youtube.  I don't think there would be many other videos like that, those ones of Monika Svobodova were about the first time I had done it that way.
Chainer
Aug 06, 2019 - permalink
Looks like that file fails when it tries to use ffmpeg to generate a screenshot. It says:

No decoder for stream #0:0, filtering impossible
Error opening filters!
Aug 14, 2019 - permalink
I'm trying to nail down the exact profile issue, chevron can you tell me if any of these play for you?

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">


Most browsers nowadays support H.264 High Profile playback as far as I can tell (apparently it's more processor intensive, so some devices used to not allow it for performance reasons).  It's hard to find documentation on, but I believe Safari only added support for it in version 11, along with H.265 playback.
chevron
Aug 14, 2019 - permalink
These play:
" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">

" class="bbc_link" target="_blank" rel="noopener noreferrer">


The others don't.
Aug 15, 2019 - permalink
That's helpful, thanks!
« first < prev Page 1 of 1 next > last »