Skip to content

Can only play h264 media? #1590

@aleasto

Description

@aleasto

Reading the documentation it would seem that fMP4 HLS is supported for any codec that the browser supports.
However what I see is that only h264 media actually works.

Here's a minimal reproducer:

<!DOCTYPE html>
<html>
<head>
  <link href="https://vjs.zencdn.net/8.23.4/video-js.css" rel="stylesheet" />
</head>

<body>
  <video-js id="player" class="video-js vjs-default-skin" controls data-setup=''>
    <source src="output.m3u8" type="application/x-mpegurl"/>
  </video-js>

  <script src="https://vjs.zencdn.net/8.23.4/video.min.js"></script>
</body>
</html>
wget https://test-videos.co.uk/vids/bigbuckbunny/mp4/av1/1080/Big_Buck_Bunny_1080_10s_2MB.mp4
ffmpeg -i Big_Buck_Bunny_1080_10s_2MB.mp4 -c:v libsvtav1 -f hls -hls_segment_type fmp4 output.m3u8
python3 -m http.server 8080
firefox http://localhost:8080

The above example works only when using -c:v libx264 in the ffmpeg command line. I've tried these codecs which all don't work:

  • -c:v libx265
  • -c:v libx265 -tag:v hvc1
  • -c:v libsvtav1
  • -c:v librav1e
  • -c:v libvpx-vp9

My browser supports all the above codecs. I've also tried in Firefox@linux, Chromium@linux, Edge@win10

MPV can play the same HLS source just fine:

mpv http://localhost:8080/output.m3u8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions