H265 choppy playback in QuickTime on Mac

I have issues with h265 files and I've reduced the bug to just demuxing and muxing an mp4. The input file plays fine in QuickTime, but the output plays with stutters. It does play fine in another player like IINA. See here for a simple demux/mux pipeline: https://gist.github.com/Doerge/903243abde51bda3468f20ca27fc966f QuickTime is a piece of garbage, but it's the default player for Mac users, so I can't get around it. Anyone experienced this, and resolved it somehow? Files below are input and output file respectively.
Gist
h265_quicktime_repro.ex
GitHub Gist: instantly share code, notes, and snippets.
9 Replies
Billal
Billal•3mo ago
Hi @Aske Most probably the reason is the missing ctts (composition offset table) from the muxed MP4 (membrane muxer doesn't store this table). I processed the input file with an updated version of membrane_mp4_plugin, I don't have a MAC, so you can try the file on your side.
Aske
Aske•3mo ago
Hey Billal! Thanks for your hard work on the h265 plugin! That one plays perfectly!
Aske
Aske•3mo ago
Is that generated with https://github.com/gBillal/ex_mp4 ?
GitHub
GitHub - gBillal/ex_mp4: MP4 reader and writer
MP4 reader and writer. Contribute to gBillal/ex_mp4 development by creating an account on GitHub.
Billal
Billal•3mo ago
Yes, it is. I wanted something to manipulate mp4 files without using pipelines.
Aske
Aske•3mo ago
Super cool! Is it possible to integrate into pipelines as well, or is this more a standalone package for other use cases? Aka. will it be possible to drop in this as a replacement for Membrane.MP4.Muxer.ISOM at some point? (sorry if this is a stupid question, I do not totally understand the dataflow in Membrane pipelines + ctts)
Billal
Billal•3mo ago
I'll try to create a PR in membrane_mp4_plugin to fix this issue. Yes you can use ex_mp4 to write a muxer however membrane_mp4_plugin is more appropriate for your use case.
Aske
Aske•3mo ago
Ok. Thanks a lot for your replies! I'll watch out for the PR in membrane_mp4_plugin
mat_hek
mat_hek•3mo ago
Thanks @Billal for handling this, I didn't know about ex_mp4! We can consider basing the mp4 plugin on it when it's ready 😉
Billal
Billal•3mo ago
Once I finish with my use case, I'll try to adapt it for usage with the membrane plugin.
Want results from more Discord servers?
Add your server