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't set a frame rate for H264 codec - crash when using AverageNonDroppableFrameRate #7

Open
mdmack opened this issue Apr 17, 2018 · 2 comments
Assignees
Labels

Comments

@mdmack
Copy link

mdmack commented Apr 17, 2018

Hi,

I'm trying to set a frame rate of 24 when using H264 codec and I don't see a way to do it.
I tried using AVVideoExpectedSourceFrameRateKey but that doesn't seem to effect final frame rate.
I tried setting AverageNonDroppableFrameRate but I'm getting a crash with NSInvalidArgumentException:
"Compression property AverageNonDroppableFrameRate is not supported for video codec type avc1"

I see that there's a default value of 30 based on this code:
if frameRate == 0 {
frameRate = 30
}
videoComposition.frameDuration = CMTimeMake(1, Int32(frameRate))

Changing this from 30 to 24 and not setting AverageNonDroppableFrameRate works.

I'm happy to open a pull request with some changes but would like to confirm the direction first.
One of the options is just to add a variable to NextLevelSessionExporter that would set the default frame rate - would that work?
Also, I might be wrong but it seems like the droppable frame rate and frame duration are not always the same values, might be good to separate those.

A related issue but in another pod if it's of value - https://stackoverflow.com/questions/44001641/using-avassetwriter-to-re-encode-h264-mov-file-how-to-set-frame-rate

Thanks,
Mike

@piemonte piemonte self-assigned this Apr 19, 2018
@piemonte piemonte added the bug label Apr 19, 2018
@piemonte
Copy link
Contributor

hey @mdmack thanks for the issue and the link. sounds like there's a couple bugs in there, will check it out.

@262hz
Copy link

262hz commented Nov 11, 2024

@mdmack Six years later, I'm facing the same issue...

Compression property AverageNonDroppableFrameRate is not supported for video codec type hvc1

Apparently, HEVC videos will not work with that compression key. As @mdmack mentioned, not setting AverageNonDroppableFrameRate and simply providing a default value seems to work.

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

No branches or pull requests

3 participants