Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can mp4v2 encapsulate h265 #37

Open
hgstudy opened this issue Jun 10, 2020 · 8 comments
Open

Can mp4v2 encapsulate h265 #37

hgstudy opened this issue Jun 10, 2020 · 8 comments

Comments

@hgstudy
Copy link

hgstudy commented Jun 10, 2020

hi
Can h265 be encapsulated?

@CarlEdman
Copy link

Definitely. Most days, I'm embedding h265 into mp4 with GPAC and then tagging it with the mp4v2 tools.

@avp24
Copy link

avp24 commented Aug 2, 2022

How to encapsulate h265 into mp4 using Mp4v2 libraries? Any sample code available to verify this instead of using GPAC?

@enzo1982
Copy link

enzo1982 commented Aug 2, 2022

Creating H.265/HEVC files is not currently supported in MP4v2, but code to implement support for it will be added soon.

I'm working on bringing features from 3rd party MP4v2 forks into this one. Support for H.265 was added in the Subler fork available in the galad87/mp4v2 repository.

Edit: Didn't realize this discussion was on the TechSmith fork. My commits to support H.265 will be added to the mp4v2.org fork, of course.

@avp24
Copy link

avp24 commented Aug 3, 2022

HI @enzo1982

Thank you for your response.
H.265/HEVC support is there in MP4V2 libraries. can access new version of library from https://github.com/Pandalzm/mp4v2-h265 repository. I referred a code for dumping H265 into MP4 file using MP4v2 libraries but facing issues.
Do your commits have support to dump H.265 into MP4v2?

@enzo1982
Copy link

enzo1982 commented Aug 5, 2022

Thank you for pointing me at the pandalzm repository. I'm not sure if I've seen this before, but in any case I didn't realize that it was a different implementation from the Subler fork. I will consider both implementations when adding H.265 support to the official MP4v2 codebase and will likely use portions of this code too.

Which one is better suited depends on what data your HEVC encoder provides. The Subler code expects all the contents of the hvcC atom to be supplied as a magic cookie when calling AddH265VideoTrack. The pandalzm code is more similar to the previous AVC/H.264 code and expects the video, sequence and picture parameters to be set separately.

So what data do you have and what are the issues you are running into?

@avp24
Copy link

avp24 commented Aug 7, 2022

Sure, I will be awaiting for the support of H.265 in official MP4v2 codebase. Also if possible do share an steps or sample code to access the AddH265VideoTrack API in your library.

The issue in this code I am observing is that I need to pass an H.265 encoded streams having NALU unit start code to be "00 00 00 01" instead of "00 00 01". I receive an encoded frame with 00 00 01 start code which this code do not support and maybe relevant changes might have to be done in this sample code to pass this header and the respective frames.

@avp24
Copy link

avp24 commented Sep 12, 2022

Hi @enzo1982

I am trying to embed live streams of H.264 for video and PCMU for audio in mp4 using mp4v2 libraries but the mp4 file is not the expected one. Also there is no sync as well.I tried with recorded files instead of live streams but still see the same issue.
Instead of mp4v2 I tried with ffmpeg and it works but cannot use ffmpeg due to some platform specific constraints.
Do you have any reference for mp4v2 based on which I can identify the problem.

@enzo1982
Copy link

Also there is no sync as well.

Are you setting the duration parameter when calling MP4WriteSample? It is set to MP4_INVALID_DURATION by default, because some codecs have a fixed sample duration and don't need this. No sync sounds like the sample duration might be wrong or missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants