{"id":3492,"date":"2013-07-02T22:04:51","date_gmt":"2013-07-02T19:04:51","guid":{"rendered":"http:\/\/mummila.net\/nuudelisoppa\/?p=3492"},"modified":"2013-07-03T21:51:08","modified_gmt":"2013-07-03T18:51:08","slug":"avconv-overlay-one-video-next-to-another-parallel","status":"publish","type":"post","link":"https:\/\/mummila.net\/nuudelisoppa\/2013\/07\/02\/avconv-overlay-one-video-next-to-another-parallel\/","title":{"rendered":"avconv: Overlay one video next to another (parallel)"},"content":{"rendered":"<p>Dare I say this is somewhat unintuitive?<\/p>\n<pre><code>$ avconv -y -i input_video_A.mp4 -vf 'movie=input_video_B.mp4[inputB] ; [in]pad=1280:0,[inputB] overlay=640:0[out]' -c:v libx264 output_video.mp4<\/code><\/pre>\n<p>This overlays one 640\u00d7480 video next to another one of the same size. You can stick a <code>setpts=PTS-STARTPTS<\/code> in there (between <em>pad=&#8230;<\/em> and <code>[inputB]<\/code>, separated by commas) to have the videos &#8220;begin in the same zero timestamp&#8221;, but what that means in practice I have yet to figure out.<\/p>\n<p>Note that this doesn&#8217;t do any audio mixing. AFAICT avconv currently in Precise can&#8217;t do mixing, but newer versions have the <code>amix<\/code> filter for it.<\/p>\n<p><strong>Edit:<\/strong> Once you&#8217;ve done mixing elsewhere, you can bring the mix in too:<\/p>\n<pre><code>$ avconv -y -i input_audio.wav -i input_video_A.mp4 -vf 'movie=input_video_B.mp4[inputB] ; [in]pad=1280:0,[inputB] overlay=640:0[out]' -c:v libx264 -c:a libfaac output_video.mp4<\/code><\/pre>\n<p>Scaling goes after overlay:<\/p>\n<pre><code>overlay=640:0,scale=640:240' -c:v libx264...<\/code><\/pre>\n<p><strong>Edit:<\/strong> Something crazier still: place one video below the other and turn the whole thing sideways before scaling down (plus make it phone-compatible by using mpeg4 instead of libx264).<\/p>\n<pre><code>$ avconv -y -i input_audio.wav -i input_video_A.mp4 -vf 'movie=input_video_B.mp4[inputB] ; [in]pad=0:960,[inputB] overlay=0:480,transpose=2,scale=640:424' -c:v mpeg4 -c:a libfaac output_video.mp4<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Dare I say this is somewhat unintuitive? $ avconv -y -i input_video_A.mp4 -vf &#8216;movie=input_video_B.mp4[inputB] ; [in]pad=1280:0,[inputB] overlay=640:0[out]&#8217; -c:v libx264 output_video.mp4 This overlays one 640\u00d7480 video next to another one of the same size. You can stick a setpts=PTS-STARTPTS in there (between pad=&#8230; and [inputB], separated by commas) to have the videos &#8220;begin in the same [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3492","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts\/3492","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/comments?post=3492"}],"version-history":[{"count":6,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts\/3492\/revisions"}],"predecessor-version":[{"id":3498,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts\/3492\/revisions\/3498"}],"wp:attachment":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/media?parent=3492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/categories?post=3492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/tags?post=3492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}