{"id":1764,"date":"2012-05-21T09:52:26","date_gmt":"2012-05-21T07:52:26","guid":{"rendered":"http:\/\/blog.fh-kaernten.at\/wehr\/?p=1764"},"modified":"2012-06-04T16:33:43","modified_gmt":"2012-06-04T14:33:43","slug":"how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad","status":"publish","type":"post","link":"https:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/","title":{"rendered":"How to cross compile ffmpeg for iOS (iPhone and iPad)"},"content":{"rendered":"<p id=\"top\" \/>In one of my latest projects I needed some audio\/video streaming capabilities for <a href=\"http:\/\/en.wikipedia.org\/wiki\/Apple_iOS\">iOS<\/a> driven devices.<\/p>\n<p>The first App. which we implemented was a audio\/HDVideo low latency conference streaming application for smart phones.<\/p>\n<p>The second app was around\u00a0 <a href=\"http:\/\/de.wikipedia.org\/wiki\/Transportstrom\"><em>MPEG<\/em>&#8211;<em>TS<\/em><\/a>\u00a0to Elementary Stream <em>demuxer<\/em> for some dreambox streaming fun \ud83d\ude42<\/p>\n<p>The framework of choice is the swiss army knife for streaming stuff,.. <a href=\"http:\/\/ffmpeg.org\/\">ffmpeg<\/a>. To be more precise, ffmpeg consists of serveral libraries and the command line programs ffmpeg, ffplay, ffprobe.<\/p>\n<h3>What do you need:<\/h3>\n<ul>\n<li>Xcode4.3<\/li>\n<li>Apple&#8217;s command line tools (Xcode -&gt; Preferences -&gt; Components)<\/li>\n<li>pkg-config -&gt; <a href=\"http:\/\/code.google.com\/p\/rudix\/downloads\/detail?name=pkg-config-0.25-1.dmg&amp;can=2&amp;q=label%3ARudix-2011\">download<\/a><\/li>\n<li>gas-preprocessor -&gt; <a href=\"https:\/\/github.com\/yuvi\/gas-preprocessor\">download<\/a> (extract under your ffmpeg root dir .\/gas-preprocessor)<\/li>\n<li>build-essentials -&gt; you can <a href=\"https:\/\/gist.github.com\/1397146\">download<\/a> an install script<\/li>\n<\/ul>\n<blockquote>\n<ul>\n<li>m4<\/li>\n<li>autoconf<\/li>\n<li>automake<\/li>\n<li>libtool<\/li>\n<\/ul>\n<\/blockquote>\n<ul>\n<li>last but not least ffmpeg -&gt; <a href=\"http:\/\/ffmpeg.org\/download.html\">download<\/a><\/li>\n<\/ul>\n<p>I used the latest <a href=\"http:\/\/git.videolan.org\/?p=ffmpeg.git;a=snapshot;h=HEAD;sf=tgz\">snapshot<\/a> available at the the time of writing. Extract the snapshot .tar to a folder of our choice.<\/p>\n<p>Thanks Michael, the lead developer of ffmpeg, the ffmpeg source comes with the convenient <a href=\"http:\/\/de.wikipedia.org\/wiki\/GNU_Build_System\">autotools<\/a> facilities. So we only need to set the correct configure flags \ud83d\ude42<\/p>\n<p><strong><span style=\"text-decoration: underline;\">1.<\/span> Compiler flags:<\/strong><\/p>\n<p style=\"padding-left: 30px;\">As we need to do some cross-compiling we need to select the compiler\/assembler which comes with our XCode<\/p>\n<p style=\"padding-left: 30px;\">&#8211;cc=&#8217;\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/usr\/bin\/arm-apple-darwin10-llvm-gcc-4.2&#8242;.<\/p>\n<p style=\"padding-left: 30px;\">&#8211;as=&#8217;.\/gas-preprocessor\/gas-preprocessor.pl \/applications\/xcode.app\/contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/usr\/bin\/arm-apple-darwin10-gcc-4.2&#8242;<\/p>\n<p style=\"padding-left: 30px;\">&#8211;arch=arm<\/p>\n<p style=\"padding-left: 30px;\">&#8211;target-os=darwin<\/p>\n<p style=\"padding-left: 30px;\">&#8211;cpu=cortex-a8<\/p>\n<p style=\"padding-left: 30px;\">&#8211;enable-pic<\/p>\n<p style=\"padding-left: 30px;\">&#8211;disable-yasm<\/p>\n<p><strong><span style=\"text-decoration: underline;\">2<\/span>. iOs SDK path:<\/strong><\/p>\n<p style=\"padding-left: 30px;\">&#8211;sysroot=&#8217;\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/SDKs\/iPhoneOS5.1.sdk&#8217;<\/p>\n<p><strong><span style=\"text-decoration: underline;\">3.<\/span> extra flags:<\/strong><\/p>\n<p style=\"padding-left: 30px;\">&#8211;extra-cflags=&#8217;-mfpu=neon -pipe -Os -gdwarf-2 -miphoneos-version-min=5.0&#8242;<\/p>\n<p style=\"padding-left: 30px;\">&#8211;extra-ldflags=&#8217;-arch armv7 -isysroot \/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Developer\/SDKs\/iPhoneOS5.1.sdk -miphoneos-version-min=5.0&#8242;<\/p>\n<p><strong><span style=\"text-decoration: underline;\">4.<\/span> configure ffmpeg library components:<\/strong><\/p>\n<p>for example:<\/p>\n<p style=\"padding-left: 30px;\">\u00a0&#8211;disable-ffmpeg<br \/>\n&#8211;disable-ffplay<br \/>\n&#8211;disable-ffprobe<br \/>\n&#8211;disable-ffserver<br \/>\n&#8211;disable-avdevice<br \/>\n&#8211;disable-avfilter<br \/>\n&#8211;disable-everything<\/p>\n<p>and then enable the\u00a0components you need<\/p>\n<p style=\"padding-left: 30px;\">&#8211;enable-decoder=xxx<br \/>\n&#8211;enable-parser=xxx<br \/>\n&#8211;enable-demuxer=xxx<\/p>\n<p>after successful completion of<em> .\/configure<\/em> run <em>make<\/em>&#8230; and voil\u00e0 \ud83d\ude42<\/p>\n<p>If you get some errors complaining about\u00a0 &#8220;error: invalid operand in inline asm: &#8221; try to disable assembler directives with<\/p>\n<p>&#8211;diasble-asm<\/p>\n<p>have fun<\/p>\n<p>Mario<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In one of my latest projects I needed some audio\/video streaming capabilities for iOS driven devices. The first App. which we implemented was a audio\/HDVideo low latency conference streaming application for smart phones. The second app was around\u00a0 MPEG&#8211;TS\u00a0to Elementary Stream demuxer for some dreambox streaming fun \ud83d\ude42 The framework of choice is the swiss &hellip; <a href=\"https:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to cross compile ffmpeg for iOS (iPhone and iPad)<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[7,13,8],"tags":[],"class_list":["post-1764","post","type-post","status-publish","format-standard","hentry","category-cool-tools","category-iphone","category-projects"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to cross compile ffmpeg for iOS (iPhone and iPad) - Mario&#039;s TinyLab<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to cross compile ffmpeg for iOS (iPhone and iPad) - Mario&#039;s TinyLab\" \/>\n<meta property=\"og:description\" content=\"In one of my latest projects I needed some audio\/video streaming capabilities for iOS driven devices. The first App. which we implemented was a audio\/HDVideo low latency conference streaming application for smart phones. The second app was around\u00a0 MPEG&#8211;TS\u00a0to Elementary Stream demuxer for some dreambox streaming fun \ud83d\ude42 The framework of choice is the swiss &hellip; Continue reading How to cross compile ffmpeg for iOS (iPhone and iPad) &rarr;\" \/>\n<meta property=\"og:url\" content=\"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/\" \/>\n<meta property=\"og:site_name\" content=\"Mario&#039;s TinyLab\" \/>\n<meta property=\"article:published_time\" content=\"2012-05-21T07:52:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-06-04T14:33:43+00:00\" \/>\n<meta name=\"author\" content=\"Mario Wehr\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mario Wehr\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2012\\\/05\\\/21\\\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\\\/#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2012\\\/05\\\/21\\\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\\\/\"},\"author\":{\"name\":\"Mario Wehr\",\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#\\\/schema\\\/person\\\/8761b4d788b13b547de9ccd6504ce62d\"},\"headline\":\"How to cross compile ffmpeg for iOS (iPhone and iPad)\",\"datePublished\":\"2012-05-21T07:52:26+00:00\",\"dateModified\":\"2012-06-04T14:33:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2012\\\/05\\\/21\\\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\\\/\"},\"wordCount\":355,\"commentCount\":1,\"articleSection\":[\"Cool Stuff\",\"iPhone\",\"Projects\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2012\\\/05\\\/21\\\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2012\\\/05\\\/21\\\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\\\/\",\"url\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2012\\\/05\\\/21\\\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\\\/\",\"name\":\"How to cross compile ffmpeg for iOS (iPhone and iPad) - Mario&#039;s TinyLab\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#website\"},\"datePublished\":\"2012-05-21T07:52:26+00:00\",\"dateModified\":\"2012-06-04T14:33:43+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#\\\/schema\\\/person\\\/8761b4d788b13b547de9ccd6504ce62d\"},\"breadcrumb\":{\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2012\\\/05\\\/21\\\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2012\\\/05\\\/21\\\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/2012\\\/05\\\/21\\\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to cross compile ffmpeg for iOS (iPhone and iPad)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#website\",\"url\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/\",\"name\":\"Mario&#039;s TinyLab\",\"description\":\"About cool\\\/interesting Projects and Technologies\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/#\\\/schema\\\/person\\\/8761b4d788b13b547de9ccd6504ce62d\",\"name\":\"Mario Wehr\",\"url\":\"https:\\\/\\\/blog.fh-kaernten.at\\\/wehr\\\/author\\\/wehr\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to cross compile ffmpeg for iOS (iPhone and iPad) - Mario&#039;s TinyLab","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/","og_locale":"en_US","og_type":"article","og_title":"How to cross compile ffmpeg for iOS (iPhone and iPad) - Mario&#039;s TinyLab","og_description":"In one of my latest projects I needed some audio\/video streaming capabilities for iOS driven devices. The first App. which we implemented was a audio\/HDVideo low latency conference streaming application for smart phones. The second app was around\u00a0 MPEG&#8211;TS\u00a0to Elementary Stream demuxer for some dreambox streaming fun \ud83d\ude42 The framework of choice is the swiss &hellip; Continue reading How to cross compile ffmpeg for iOS (iPhone and iPad) &rarr;","og_url":"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/","og_site_name":"Mario&#039;s TinyLab","article_published_time":"2012-05-21T07:52:26+00:00","article_modified_time":"2012-06-04T14:33:43+00:00","author":"Mario Wehr","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mario Wehr","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/#article","isPartOf":{"@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/"},"author":{"name":"Mario Wehr","@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#\/schema\/person\/8761b4d788b13b547de9ccd6504ce62d"},"headline":"How to cross compile ffmpeg for iOS (iPhone and iPad)","datePublished":"2012-05-21T07:52:26+00:00","dateModified":"2012-06-04T14:33:43+00:00","mainEntityOfPage":{"@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/"},"wordCount":355,"commentCount":1,"articleSection":["Cool Stuff","iPhone","Projects"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/","url":"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/","name":"How to cross compile ffmpeg for iOS (iPhone and iPad) - Mario&#039;s TinyLab","isPartOf":{"@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#website"},"datePublished":"2012-05-21T07:52:26+00:00","dateModified":"2012-06-04T14:33:43+00:00","author":{"@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#\/schema\/person\/8761b4d788b13b547de9ccd6504ce62d"},"breadcrumb":{"@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/blog.fh-kaernten.at\/wehr\/2012\/05\/21\/how-to-cross-compile-ffmpeg-for-ios-iphone-and-ipad\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.fh-kaernten.at\/wehr\/"},{"@type":"ListItem","position":2,"name":"How to cross compile ffmpeg for iOS (iPhone and iPad)"}]},{"@type":"WebSite","@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#website","url":"https:\/\/blog.fh-kaernten.at\/wehr\/","name":"Mario&#039;s TinyLab","description":"About cool\/interesting Projects and Technologies","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.fh-kaernten.at\/wehr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.fh-kaernten.at\/wehr\/#\/schema\/person\/8761b4d788b13b547de9ccd6504ce62d","name":"Mario Wehr","url":"https:\/\/blog.fh-kaernten.at\/wehr\/author\/wehr\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/posts\/1764","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/comments?post=1764"}],"version-history":[{"count":0,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/posts\/1764\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/media?parent=1764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/categories?post=1764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.fh-kaernten.at\/wehr\/wp-json\/wp\/v2\/tags?post=1764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}