0

Apple H.264 Keyframe still has issues

I've seen discussions from 3 years ago where this was called solved, but its still occurring.  

2018 and 2019 16" macbook pros, 16gb ram. macos 14.2 and 15.  Wirecast 14.2.1

Using Apple H264 with 1080p30, bitrates between 6000 and 12000 Mbps, keyframe every 60, 30, or 15 frames. 

Call it codec breathing or blocking frames, I'm still getting bad glitches corresponding to the keyframe intervals.  I really want to use apple h264 to keep the processor use low, as it jumps from 9% to 50-60% when using Mainconcept high profile.  x.264 doesn't work with our caption provider.

48replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Billy Davidson said:
    macos 14.2 and 15

     Sorry but I don't understand this. macOS is current 11.5.1

    Billy Davidson said:
    Wirecast 14.2.1

     The current version of Wirecast is 14.3. Please update as updates include fixes.

    Billy Davidson said:
    Call it codec breathing or blocking frames,

     This is an issue with Apple H.264 in various circumstances. It can vary widely making it problematic for live streaming or, if constrained, may result in breathing. The issue is the codec. 

    Billy Davidson said:
    Using Apple H264 with 1080p30, bitrates between 6000 and 12000 Mbps, keyframe every 60, 30, or 15 frames. 

     Its impact is also relative to the source and the amount of data it needs between keyframes. You may need to experiment based on content. Using higher bit rates can help though. 

     

    Billy Davidson said:
    50-60% when using Mainconcept high profile

     That should still be a safe range of use. Dropped frames and related issues can happen as you go too far above 60% though.

    Like
      • Billy Davidson
      • Streaming Studio Manager
      • Billy_Davidson
      • 9 mths ago
      • Reported - view

      CraigS 

      My bad, Mac os 11.5 and 11.4.1
       

      I'm aware of the new version.  Does Wirecast 14.3 include specific fixes for this issue? If it's an issue with Apple H.264 and not wirecast, how will updating help?  I do plan on updating once current productions are wrapped, but I do grow weary of this being the first line of defense on an otherwise working system.  

      Content is usually a live video source coming in through a blackmagic mini recorder, but it happens with local files as well.  This encoder is unusable as is, and apparently has been for at least 3 years judging by other forum posts.  Unless you know of specific encoder settings or content parameters that make it work.

      You specifically recommend using Apple H.264 in the "How to lower CPU use" post, but there's no mention of this mystery problem that may be an issue.  

      I fail to see how topping out around 60% is 'safe' when "above 60%" will result in dropped frames.

      I'm sorry if I'm coming across as argumentative, but I just got burned by this issue and it's still raw.  I realize you are dealing with a lot of issues and I do appreciate your support, but I feel this a known issue that I'm having to dig into forums to find instead of it being in the release notes or manual.  Honestly with this big of an output problem I'm surprised the encoder is enabled in software.

      Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 9 mths ago
      • Reported - view

      Billy Davidson Updates include fixes so if you see an issue updating is the first line of defense. If there's a fix it would be in the update.

      Apple H.264 seems to have been designed for VOD encoding rather than live use. This is Apple's codec so any workarounds bring other potential challenges. Apple H.264 is a  "last resort" if high CPU use is creating greater issues. Exact encoder performance is always depending to some extent on the source.

      Billy Davidson said:
      I fail to see how topping out around 60% is 'safe' when "above 60%" will result in dropped frames.

      Test and examine the results.

      We've spent a significant time examining the Apple H.264 and it has limitations.

      Like
      • Billy Davidson
      • Streaming Studio Manager
      • Billy_Davidson
      • 9 mths ago
      • Reported - view

      CraigS 

      "If there's a fix it would be in the update."  

      I looked at the release notes and there is no mention of a fix for this issue.  Yes I understand the concept of updates, but you have not attempted to address this specific issue so I'm not going to rebuild my show mid run.  In my testing on a different machine (16" Macbook Pro 2019 16GB MacOS 11.5) there is no change with this issue in Wirecast 14.3.

      "We've spent a significant time examining the Apple H.264 and it has limitations."

      Please post the limitations.  If you have and I have missed them then I apologize.

      If you know of settings that work with this encoder (or ones that don't work) I'd love to see them.  As I test more I'm finding the output of the encoder unusable on multiple machines with multiple settings on multiple OS versions and multiple hardware revisions.  I did test before taking it live, but in testing it was fine.  The issue didn't show up until mid-stream.  Once present it seemed to come and go for the rest of the stream.

      "Apple H.264 is a  "last resort" " 

      That's not how the post on reducing CPU use reads.  Or the manual unless I missed something.  If the issue is with Apple's encoder thats fine, I understand that it's out of your hands.  But don't leave every one of your users to find this issue independently when you know it exists.  

      Like
  • Billy Davidson said:
    This encoder is unusable as is,

     It depends on the circumstances. It certainly can be used and the results can be acceptable. It depends on the use case.

     

    Billy Davidson said:
    judging by other forum posts. 

    People who are using it successfully generally aren't reporting issues. Forum posts are always going to be about those with issues and may often be a small minority of users.

    Like
  • Billy Davidson said:
    I looked at the release notes and there is no mention of a fix for this issue.

     Some fixes are not listed.

    Billy Davidson said:
    Please post the limitations.  If you have and I have missed them then I apologize.

     Apple H.264 is a highly variably bit rate codec. Unless your upload speed has a lot of headroom (more than our typically recommended double) you can have dropped frames or even lost the connections.

    Any attempts to constrain Apple H.264 results in more exaggerated codec breathing (sharp to blurry to sharp image). How visible this is may depend on the content being streamed.

    Apple H.264 tends to require higher bit rates to maintain the same quality as a lower bit rate x264 codec. Of course, higher bit rates further increases the risk of dropped frames and lost connections if you don't have the headroom.

    Apple H.264 is implemented by Apple so generally, we can't alter its performance without "workarounds" in coding which results in additional problems.

    If you need to lower the bit rate and weigh the above potential drawbacks it's worth using. 

    Like
  • Billy Davidson said:
    If the issue is with Apple's encoder thats fine, I understand that it's out of your hands.

     We're going to write something up regarding this.

    Sorry about not having written it up but that's in part, due to ongoing investigations on working around the codec's behavior.

    BTW we've found that Apple H.264 is improved on M1/Apple Silicon Macs in our testing.  

    Like
  • CraigS said:
     Some fixes are not listed.

     Ok.  I did test 14.3 and found no improvement in this area.  As I said, I am going to update as systems come back in from jobs, but not mid show.

     

     CraigS said:
     Apple H.264 is a highly variably bit rate codec. Unless your upload speed has a lot of headroom (more than our typically recommended double) you can have dropped frames or even lost the connections.

     Our main office has a 300/300 connection.  A lot of our systems are portable so the onsite connection varies, but we're rarely lower than 25 Mbit upload, and our target is 7500 kbit/sec on the encoder.  

     

    CraigS said:
    Any attempts to constrain Apple H.264 results in more exaggerated codec breathing

      Can you expand on this?  What counts as constraining it from an operators perspective?

     

    CraigS said:
     We're going to write something up regarding this.

     Thank you.  I look forward to reading it.

     

    CraigS said:
    BTW we've found that Apple H.264 is improved on M1/Apple Silicon Macs in our testing.  

      I note the use of the word improved, not solved.  Is there any further info you can share on this?  

    Like
  • Billy Davidson said:
    What counts as constraining it from an operators perspective?

     We were looking at forcing CBR but that made the breathing worse. The codec distributes bits to keyframes which makes the nonkeyframes look worse.

    Billy Davidson said:
    I note the use of the word improved, not solved.

     Apple's implementation seems to be better on M1. This is their improvement.

    Like
  • Billy Davidson said:
    we're rarely lower than 25 Mbit upload, and our target is 7500 kbit/sec on the encoder.  

     You might be able to push the bit rate higher for improved quality upstream. The CDN /Server might make HLS variants from that.

    Like
  • Same situation here, I spent my hard-earned money on apple computers and now the best format doesn't work. I don't know who I direct my

    Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 8 mths ago
      • Reported - view

      Billy Davidson Thannillo Araujo 
      There are limitations to Apple H.264 and live streaming, unfortunately. The issue will be more or less obvious depending on the content. You can change the Key Frame Rate in the encoder to see if it helps.

      I can bring up with the developers again but they may consider an issue Apple has to address in their "video toolbox" 

      Perhaps provide a short clip of under 1 minute (do a local recording) with complete settings and they can see it relative to your specific content.

      Like
  • Just kicking this to make sure its still alive.  Still would love to see recommended settings for this encoder.  

    I thought I posted this, but don't see it: I have experimented on an M1 iMac with 14.3.1 and the issue is still unacceptable at 1080p30 7.5 Mbps.

    Like
  • Investigation WIRE-17969 for reference.

    Like
  • Any progress on Apple H.264 recommended settings?

    Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 6 mths ago
      • Reported - view

      Billy Davidson Still in analysis and we're finding additional issues with Apple's Video Toolbox on M1Pro/Max MBPs that look to be an issue we need to report to Apple (even Handbrake users are seeing issues).

      Like
  • Hi ! Is there some news about this issue ? Very frustrating... Please note that with the same file and encoding settings, M1 Apple H264 native encode works flawlessly with OBS studio. Hope you will find the solution !!

    Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax There seems to be an issue with Apple's Video Toolbox. 

      Like
      • jujax
      • jujax
      • 2 mths ago
      • Reported - view

      CraigS I understand but how can we explain that OBS can handle it without issues ?

      Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax There are times when OBS "cheats" a bit on what it's using. We've looked at doing such but don't feel comfortable going in that direction and prefer Apple to address the issue. 

      Also, generally, Apple H.264 has drawbacks and generally shouldn't be used unless one has an overtaxed system (high CPU use) so our general approach is to continue to make Wirecast more efficient so one is less likely to need Apple H.264.

      Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax BTW in our most recent tests we found OBS has the same issue. Perhaps something has changed with an OBS update. 

      If you can give us the OBS version and macOS version and make sure both OBS and Wirecast are using the exact same settings we can look at this.

      The source may be a factor as high motion might be more prone to the issue so include that as well.

      Like
  • CraigS  I use obs 27.1.3 on mac os 12.1 with a 8gb ram M1 Macmini for a 24/7 stream on Twitch. Sources are only 25p - 1920x1080 proresHQ files encoded with DaVinciResolve and I let Apple codec original settings on both softwares. OBS indicates an average 14,5% cpu usage

    Like
  • jujax said:
    I use obs 27.1.3

     Just pointing out the current version of OBS is 27.2.2 which is what we'd test on.
     

    jujax said:
    let Apple codec original settings on both softwares.

     Wirecast has various encoder settings as does OBS and it's a custom Advanced setting. Many of the settings will impact quality so you can't do a straight comparison in any streaming encoder as they all use different defaults (and OBS doesn't have a real "default" for this).

     
     

    Please understand when reporting an issue it must include information so it can be reproduced. Troubleshooting general statements are not reliable. Different settings usually yield different results.

    Like
  • CraigS I use Apple Hardware encoding with OBS, if you choose it, which is not the case on your screenshot, you will see that there's very few parameters, only bitrate, keyframes, profile and bframes, which I let just as they are. Just tried 27.2.2 and no issue with the same settings...it works well even if I try different settings. The issue I report is about Wirecast, and if you have a setting which work with Apple codec without breathing, it would be very nice to share it to us !

    Like
  • jujax said:
    which I let just as they are

     Which does not match what Wirecast uses. 
    There may be as many as 11 Apple H.264 presets in Wirecast.
    None match what you show.
    Wirecast has frame size and frame rate settings and the keyframe rate in Wirecast is not auto and must be set by the user and defaults to double the frame rate.

    You would have to create a custom setting in Wirecast to match that or otherwise use a Wirecast preset and match that in OBS (including canvas, frame size and frame rate as well as keyframe rate).
     


     

    Like
  • Thanks Craig for the explanation, this is pretty much what I did to adapt the "Defaut : 1080p30 (5Mbps) Apple H.264" preset. I only stream Apple Prores HQ 1080p25 files as a playlist, files are stored in internal SSD. I constantly get breathing and Wirecast indicates 35% of cpu usage. Do you think I could try something else to eliminate the issue ? ps : "élevé" means "high" in french ;-)

    Like
  • jujax said:
    this is pretty much what I did to adapt the "Defaut : 1080p30 (5Mbps) Apple H.264" preset.

    Did you change bit rate to 6000kbps and frame rate to 25fps?
    It's hard to know what keyframe rate OBS is using when set to Auto. In Wirecast, you'd set the keyframe rate to 50 for 25fps streaming. Please confirm.

    Like
  • On my screenshot you can see frame rate (images par seconde) is 25 and keyframe (image clé toutes les) is 50... I already tried 6000kbps but no improvement 

    Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax Thanks for that.
      Can you link to recording from OBS and Wirecast so we can download? They can be very short. Just long enough to show the breathing in Wirecast and good recording in OBS of the exact same point in the video.

      Like
  • Craig, thanks to take time for me ! Look at the trees at first plan...

    On little screens it's acceptable, on bigger, like 60" TV's or VP's it's very annoying

    OBS

    https://vimeo.com/684411683

    Wirecast

    https://vimeo.com/684411715/9a75019412

    Like
  • jujax said:
    OBS
    https://vimeo.com/684411683

     I get unauthorized for this link.

    Like
      • jujax
      • jujax
      • 2 mths ago
      • Reported - view

      CraigS Sorry, try again please !

      Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax Thanks. I can clearly see the issue in Wirecast compared to OBS. Developers will investigate.

      Like
      • jujax
      • jujax
      • 2 mths ago
      • Reported - view

      CraigS Good to hear !

      Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax 👍

      Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax The developers mentioned that they had looked at this previously and found that to avoid the issue there would be a data rate spike. Users with limited streaming bandwidth would risk disconnecting the stream by exceeding what their ISP is providing. So the consideration in implementing the feature would be to make it an optional setting. 

      Like
      • jujax
      • jujax
      • 2 mths ago
      • Reported - view

      CraigS Thanks for your answer Craig ! If I understand I should wait a future update or beta with this feature ?

      Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view
      jujax said:
      If I understand I should wait a future update or beta with this feature ?

       We are now looking at it as a user option. We have looked into the concept so know how to make the change but there's some discussion on User Interface (and the user understanding the implications). I can't say more than that but offer your comparison does show the difference and the need.

      Like
  • Ok ! If you need somebody to test you can ask me it would be a pleasure !

    Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax Thanks for offering. 👍

      Like
  • Hi Craig any update ? I found a workaround by producing with Wirecast > NDI Output > OBS encoding... do you think it's a reliable workflow on long term ?

    Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax This will take a bit of time to develop and test.

      Are you running into CPU issues? Otherwise, I'd stick to X264.

      Like
      • jujax
      • jujax
      • 2 mths ago
      • Reported - view

      CraigS Thanks for your answer. I run an (experimental) 24/7 stream on a single M1 since many months and I really appreciate the low cpu usage and the render quality with Apple H264, by the way It works since yesterday without issue ! Thanks to the NDI solution, I can get the best of the both softwares...take a look ! https://www.twitch.tv/valloiretv

      Like
      • Billy Davidson
      • Streaming Studio Manager
      • Billy_Davidson
      • 2 mths ago
      • Reported - view

      jujax so to clarify, you're currently using ndi output from wirecast, into OBS, and OBS is encoding using apple H264?

      Like
      • jujax
      • jujax
      • 2 mths ago
      • Reported - view

      Billy Davidson yes absolutely !

      Like
      • CraigSModerator
      • Telestream Desktop Forum Moderator
      • CraigS
      • 2 mths ago
      • Reported - view

      jujax Due to the nature of the Apple H.264 codec streams will fail if the user has bandwidth limits since the codec peaks more than 2x our recommended ISP upload bandwidth for encodes. OBS is free after all and has no direct support costs as well so there's no great concern for customers who fail. As a commercial product, Wirecast has to make sure built-in solutions work so we need to make sure customers understand when it fails and how to limit the feature to solve a problem. Again we've tested a similar implementation and verified the data peaks so we have to look for a more complex implementation.

      Like
      • jujax
      • jujax
      • 2 mths ago
      • Reported - view

      CraigS  I totally agree with the fact that Wirecast and OBS can't be compared, I need Wirecast because of its complex features, its interface, its stability... If it can help, weirdly Twitch won't accept Apple H.264 stream if I check "Limit rate" in OBS... 🙃

      Like
  • jujax said:
    weirdly Twitch won't accept Apple H.264 stream if I check "Limit rate" in OBS

    Understandable given the codec isn't meant to be CBR or peak limited. 

    Like 1
Like Follow
  • 2 mths agoLast active
  • 48Replies
  • 187Views
  • 5 Following