{"id":11741,"date":"2015-07-17T15:33:40","date_gmt":"2015-07-17T19:33:40","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=11741"},"modified":"2015-07-17T15:33:40","modified_gmt":"2015-07-17T19:33:40","slug":"hardware-audio-encoding-avmovie-brings-back-quicktime-features","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/07\/17\/hardware-audio-encoding-avmovie-brings-back-quicktime-features\/","title":{"rendered":"Hardware Audio Encoding, AVMovie Brings Back QuickTime Features"},"content":{"rendered":"<p><a href=\"http:\/\/www.subfurther.com\/blog\/2015\/06\/25\/av-wwdc-part-1-hot-dog-the-avmovie\/\">Chris Adamson<\/a>:<\/p>\n<blockquote cite=\"http:\/\/www.subfurther.com\/blog\/2015\/06\/25\/av-wwdc-part-1-hot-dog-the-avmovie\/\">\n<p>We&rsquo;ve found we have to fall back to the software encoder because the hardware encoder (<code>kAppleHardwareAudioCodecManufacturer<\/code>) would cause <code>ExtAudioFileWrite()<\/code> to sometimes fail with <code>OSStatus<\/code> -66570 (<code>kExtAudioFileError_AsyncWriteBufferOverflow<\/code>). So I asked about that and was told &ldquo;oh yeah, we don&rsquo;t support hardware encoding anymore&#8230; the new devices don&rsquo;t need it and the property is just ignored&rdquo;. I Slacked this to my boss and his reaction was &ldquo;would be nice if that were in the documentation!&rdquo;<\/p>\n<p>[&#8230;]<\/p>\n<p>Enter Tim [Monroe], and the new <code>AVMovie<\/code>. This is a new editing API, an alternative to the <code>AVComposition<\/code> stuff, and is much more strongly influenced by the old QuickTime APIs (and, in turn, by the QuickTime file format itself). This brings back some of the important concepts of the old QuickTime API, such as modifier tracks: tracks that consist only of instructions to modify other tracks at certain times. <code>AVComposition<\/code> offered some support for this with opacity ramps and affine transforms (in the hideously-named <code>AVMutableVideoCompositionInstruction<\/code> class) but QuickTime was always able to offer a much broader range of functionality, and could save those instructions in the file itself until they were needed for a final export.<\/p>\n<p>[&#8230;]<\/p>\n<p>And yes, I did say &ldquo;headers&rdquo;. The new QuickTime-inspired editing APIs aren&rsquo;t in the OS X 10.11 docset yet, and they don&rsquo;t exist at all on iOS.<\/p>\n<p>I&rsquo;m certainly happy to see this new approach to editing video, although it&rsquo;s going to be hard to clarify when to use <code>AVMovie<\/code> versus <code>AVComposition<\/code>. For example, doing compositing work with affine transforms and opacity, or pulling in Core Animation graphics, may work better with the <code>AVComposition<\/code> APIs, at least until <code>AVMovie<\/code> is built out and understood. And for the hardcore, there&rsquo;s always the low-level approach of doing your own rendering, perhaps with Core Image, and writing samples with <code>AVAssetWriter<\/code>.<\/p>\n<p>[&#8230;]<\/p>\n<p>I wonder about the internal design and architectural politics that led to this about-face on AV Foundation editing, after holding to the company line for so long on the <code>AVComposition<\/code> stuff.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Chris Adamson: We&rsquo;ve found we have to fall back to the software encoder because the hardware encoder (kAppleHardwareAudioCodecManufacturer) would cause ExtAudioFileWrite() to sometimes fail with OSStatus -66570 (kExtAudioFileError_AsyncWriteBufferOverflow). So I asked about that and was told &ldquo;oh yeah, we don&rsquo;t support hardware encoding anymore&#8230; the new devices don&rsquo;t need it and the property is just [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[95,273,587,164,31,1137,30,1199,71,271,97],"class_list":["post-11741","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-audio","tag-avfoundation","tag-core-audio","tag-documentation","tag-ios","tag-ios-9","tag-mac","tag-mac-os-x-10-11","tag-programming","tag-quicktime","tag-video"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=11741"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11741\/revisions"}],"predecessor-version":[{"id":11742,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/11741\/revisions\/11742"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=11741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=11741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=11741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}