1

I am working on a project where we are splicing HLS video segments. The HLS standard conveniently includes an #EXT-X-DISCONTINUITY directive to signal that the player should be ready for video that has a different SPS or PPS (a change in the encoded resolution would guarantee you need such a thing).

On an apple iPad the mixed streams play fine.

Unfortunately, the piece of equipment we are targeting fails to implement this part of the HLS specification. We have determined that both of the clips can play on the device independently, but when they are part of the same HLS stream, the device malfunctions (refuses to render any of the secondary clip and resumes rendering after it gets back to media from the primary clip).

Right now we're considering re-encoding one of the clips to match the one we have less control over. I already was able to adjust the profile and level using the answer in How can I set a h.264 profile level with ffmpeg?

Now I need to harmonize the log2_max_frame_num_minus4. How do I tell ffmpeg to use 5 for this value?

1 Answer 1

1

You can't. You'd have to re-program x264 (the H.264 encoder) to do so.

You really have to go into the source (encoder/set.c) and hardcode it, as I don't believe it was ever intended for anyone to set this value.

Or you manually fix the bytes in the SPS corresponding to that value, risking to break the H.264 syntax (because other parameters depend on that value, of course).

1
  • I don't think it's a risk. I think alltering that value in an existing encoding is pretty much guaranteed to break the stream (and almost everything in the SPS and PPS is like that).
    – Mutant Bob
    Commented Mar 18, 2015 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .