Keyframe frequency (Handbrake for HLS)
-
- Posts: 4
- Joined: Fri Jan 12, 2018 5:34 pm
Keyframe frequency (Handbrake for HLS)
Hello! We're looking to segment our videos using HLS, but to do that we need to set a keyframe / sync frame / reference frames at every 5 seconds. Is there a way to tell Handbrake to encode with keyframes at fixed intervals?
Re: Keyframe frequency (Handbrake for HLS)
Set keyint and min-keyint to 5 times your framerate.
Re: Keyframe frequency (Handbrake for HLS)
To be clear, using a HandBrake preset using the x264 encoder, add keyint=5:min-keyint=5 to the additional options field on the video tab. The Production presets in the nightly build do something similar, for reference.
Re: Keyframe frequency (Handbrake for HLS)
Guys, that's 5 frames, not 5 seconds. If you want it every 5 seconds, you need to multiply the frame rate by 5
Also, using intra-refresh=1 might help in an HLS streaming scenario, though I have never tried either (of HLS and PIR) myself.
Also, using intra-refresh=1 might help in an HLS streaming scenario, though I have never tried either (of HLS and PIR) myself.
Re: Keyframe frequency (Handbrake for HLS)
Ah, sorry. mduell had it correct and I fubared it. So if your frame rate is 29.97 or 30, you probably want keyint=150:min-keyint=150 which is 5*30, etc.
-
- Posts: 4
- Joined: Fri Jan 12, 2018 5:34 pm
Re: Keyframe frequency (Handbrake for HLS)
Thanks Everyone! With a minor modification, this worked perfectly. I did have to add scenecut=0, which seems like it would be redundant with min-keyint, but didn't give clean boundaries without it. So the final string was "keyint=150:min-keyint=150:scenecut=0:"
Thank you!
Thank you!
Re: Keyframe frequency (Handbrake for HLS)
Good call on scenecut. Glad it's working for you.