Unstable video stream after muxing from MKV (H.265) to MP4 using FFmpeg for web playback

194 Views Asked by At

I have been encountering an issue while using FFmpeg to mux a video file from MKV format (encoded with H.265) to MP4 format, specifically for web playback. The resulting video stream appears to be unstable and exhibits inconsistencies across different platforms and browsers.

The muxed video works perfectly on Google Chrome, indicating that the MP4 file itself is not the root cause of the issue.

I am aware that Firefox does not support H.265 natively, so it's expected that the video won't play on that browser.

However, I expected the H.265-encoded MP4 video to be compatible with IOS Safari, which has support for H.265 MP4 playback. Surprisingly, the video is missing IOS Safari.

Transcoding the video is not a viable option due to hardware constraints yet I did test this and it seems that then playback works correctly then.

I am using this command to mux with ffmpeg

ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4

This produces the output.mp4

In my html page I include this this video like this

    <video src="output.mp4" controls></video>

I have also tried specifying the source explicitly

    <video id="video" controls>
        <source src="output.mp4" type="video/mp4">
    </video>

I would greatly appreciate any insights or suggestions on how to resolve this issue and ensure stable playback of the H.265-encoded MP4 video on IOS Safari without transcoding .

0

There are 0 best solutions below