{"id":59407,"date":"2023-05-20T03:01:39","date_gmt":"2023-05-19T17:01:39","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=59407"},"modified":"2023-05-20T09:08:37","modified_gmt":"2023-05-19T23:08:37","slug":"ffmpeg-mux-video-and-audio-media-browsing-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-mux-video-and-audio-media-browsing-tutorial\/","title":{"rendered":"Ffmpeg Mux Video and Audio Media Browsing Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/voiceover.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Ffmpeg Mux Video and Audio Media Browsing Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/voiceover_more.jpg\" title=\"Ffmpeg Mux Video and Audio Media Browsing Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Ffmpeg Mux Video and Audio Media Browsing Tutorial<\/p><\/div>\n<p>Onto yesterday&#8217;s <a title='Ffmpeg Mux Video and Audio Primer Tutorial' href='#fmvapt'>Ffmpeg Mux Video and Audio Primer Tutorial<\/a> &#8230;<\/p>\n<blockquote><p>\nThere be a flowerin&#8217; of inner warmth and glo&#8217; towards all our readers, youngins and oldins alike &#8230; like!\n<\/p><\/blockquote>\n<p>Yes, we&#8217;re involving good ol&#8217; HTML5 <a target=_blank title='Great link' href='http:\/\/www.html5rocks.com\/en\/tutorials\/file\/dndfiles\/'>File API<\/a> Object Javascript logic, so our &#8220;Intranet&#8221; savvy downloaders out there &#8230;<\/p>\n<blockquote><p>\nFull o&#8217; inner warmth and glo&#8217; towards each other &#8230; like!\n<\/p><\/blockquote>\n<p> &#8230; can easily browse for their two media input files, and for the first time ever integrating <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/client_browsing.html-------------------------------GETME\">our ever tweaked<\/a> inhouse <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/client_browsing.html-------------------------------GETME\">client_browsing.htm<\/a> <font size=1>(also a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/client_browsing.htm\">standalone proposition<\/a>)<\/font> (we&#8217;d like you to download to MAMP Document Root&#8217;s HTMLCSS subfolder) we add <a target=_blank title='Event oncontextmenu information from W3schools' href='https:\/\/www.w3schools.com\/jsref\/obj_mouseevent.asp'>&#8220;oncontextmenu&#8221;<\/a> event changes to its input type=file browser <font color=blue>hosting parent iframe element onload event Javascript function as per <\/font> &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  var voaf='', voaftwo='';<br \/>\n<br \/>\n  function checkif(iois, ival) {<br \/>\n    if (iois.src.indexOf('?d=') != -1) {<br \/>\n    var aconto = (iois.contentWindow || iois.contentDocument);<br \/>\n    if (aconto != null) {<br \/>\n       if (aconto.document) { aconto = aconto.document; }<br \/>\n       if (aconto.getElementById('files')) {<br \/>\n         if (voaf == '') {<br \/>\n         voaf=iois.src;<br \/>\n         iois.setAttribute('data-parentspan', 's' + ival.replace('inv.mp4','cbi').replace('inva.mp4','cbix'));<br \/>\n         document.getElementById('myh1').title='s' + ival.replace('inv.mp4','cbi').replace('inva.mp4','cbix');<br \/>\n         document.getElementById('myh1').setAttribute('data-url', iois.src);<br \/>\n         setInterval(voaff, 1000);<br \/>\n         } else if (voaftwo == '') {<br \/>\n         voaftwo=iois.src;<br \/>\n         iois.setAttribute('data-parentspan', 's' + ival.replace('inv.mp4','cbi').replace('inva.mp4','cbix'));<br \/>\n         document.getElementById('myh3').title='s' + ival.replace('inv.mp4','cbi').replace('inva.mp4','cbix');<br \/>\n         document.getElementById('myh3').setAttribute('data-url', iois.src);<br \/>\n         \/\/alert(iois.id + ' data-parentspan=' + iois.getAttribute('data-parentspan'));<br \/>\n         }<br \/>\n         \/\/alert(iois.id + ' data-parentspan=' + iois.getAttribute('data-parentspan'));<br \/>\n         aconto.getElementsByTagName('h1')[0].style.opacity='0.0';<br \/>\n         \/\/alert('here');<br \/>\n         aconto.getElementById('files').style.position='absolute';<br \/>\n         aconto.getElementById('files').style.left='0px';<br \/>\n         aconto.getElementById('files').style.top='0px';<br \/>\n         aconto.getElementById('files').style.zIndex='99';<br \/>\n         aconto.getElementById('files').style.marginLeft='10px';<br \/>\n         aconto.getElementById('files').style.marginTop='8px';<br \/>\n         aconto.getElementById('files').style.visibility='visible';<br \/>\n         aconto.getElementById('files').style.display='block';<br \/>\n         aconto.getElementById('files').style.backgroundColor='#eeeeee';<br \/>\n         aconto.getElementById('files').setAttribute('data-hostcont', ival);<br \/>\n         aconto.getElementById('files').setAttribute('data-hostspan', 's' + ival.replace('inv.mp4','cbi').replace('inva.mp4','cbix'));<br \/>\n         <font color=blue>aconto.getElementById('files').oncontextmenu = function(event) { var suf=event.target.getAttribute('data-hostspan');  parent.document.getElementById(suf).innerHTML=\\\"\" . str_replace(\"\\\\\",\"\\\\\\\\\",dirname(__FILE__) . DIRECTORY_SEPARATOR) . \"\\\" + event.target.getAttribute('data-hostcont');  }<\/font><br \/>\n         if (ival == 'inv.mp4') {<br \/>\n           aconto.getElementById('files').accept='video\/*';<br \/>\n           aconto.getElementById('files').title='Click to browse for video else right click or two finger gesture to make disappear.';<br \/>\n         } else {<br \/>\n           aconto.getElementById('files').accept='video\/*,audio\/*';<br \/>\n           aconto.getElementById('files').title='Click to browse for video or audio else right click or two finger gesture to make disappear.';<br \/>\n         }<br \/>\n         \/\/alert('there');<br \/>\n         aconto.getElementById('dwstyle').innerHTML+=\\\"&lt;style&gt; #files::before { content: '\\\" + ival + \\\"'; } &lt;\/style&gt;\\\";<br \/>\n       }<br \/>\n    }<br \/>\n    }<br \/>\n  }<br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; to allow a user who prefers the overlayed <strong>div contenteditable=true alternative (which speaks back to the HTML form textarea conduit when that form&#8217;s <a target=_blank title='Event oncontextmenu information from W3schools' href='https:\/\/www.w3schools.com\/jsref\/event_onsubmit.asp'>&#8220;onsubmit&#8221;<\/a> <font color=purple>event is called<\/font>) onto yesterday&#8217;s <i>exclusively textarea<\/i> methodology<\/strong> &#8230;<\/p>\n<p>&lt;?php echo &#8221;<br \/>\n<code><br \/>\n  function overlay() {<br \/>\n   var rect=document.getElementById('fcommand').getBoundingClientRect();<br \/>\n   document.getElementById('moreb').style.position='absolute';<br \/>\n   document.getElementById('moreb').style.left='' + rect.left + 'px';<br \/>\n   document.getElementById('moreb').style.top='' + rect.top + 'px';<br \/>\n   document.getElementById('moreb').style.width='96%'; \/\/' + rect.width + 'px';<br \/>\n   document.getElementById('moreb').style.height='' + rect.height + 'px';<br \/>\n   document.getElementById('moreb').style.border='1px solid black';<br \/>\n   document.getElementById('moreb').style.paddingLeft='20px';<br \/>\n   document.getElementById('moreb').style.backgroundColor='#f9f9f9';<br \/>\n   document.getElementById('fcommand').style.opacity='0.0';<br \/>\n   document.getElementById('moreb').innerHTML='ffmpeg\" . $ffmpegsuf . \" -i &lt;span id=scbi&gt;&lt;iframe onload=checkif(this,\\\"inv.mp4\\\"); scrolling=no frameborder=0 id=cbi data-type=file data-value=inv.mp4 data-accept=\\\"video\/*\\\" style=\\\"display:inline-block;height:40px;width:92px;vertical-align:middle;\\\" src=\\\"\/HTMLCSS\/client_browsing.htm?d=975964842271&left=y\\\"&gt;&lt;\/iframe&gt;&lt;\/span&gt; -i &lt;span id=scbix&gt;&lt;iframe onload=checkiftwo(this,\\\"inva.mp4\\\"); scrolling=no frameborder=0 id=cbix data-type=file data-value=inva.mp4 data-accept=\\\"video\/*\\\" style=\\\"display:inline-block;height:40px;width:106px;vertical-align:middle;\\\" src=\\\"\/HTMLCSS\/client_browsing.htm?d=975964842271&right=y\\\"&gt;&lt;\/iframe&gt;&lt;\/span&gt; -c copy -map 0:v:0 -map 1:a:0 -shortest out.mp4 &gt; voiceover.bad';<br \/>\n  }<br \/>\n<br \/>\n  <font color=purple>function mergechanges() {<br \/>\n     if (document.getElementById('scbi').innerHTML.indexOf('&lt;') == -1) {<br \/>\n       document.getElementById('fcommand').value=document.getElementById('fcommand').value.replace(' inv.mp4 ', ' ' + document.getElementById('scbi').innerHTML + ' ');<br \/>\n       \/\/alert('not oops ' + document.getElementById('fcommand').value);<br \/>\n     } \/\/else {<br \/>\n       \/\/alert('oops');<br \/>\n     \/\/}<br \/>\n     if (document.getElementById('scbix').innerHTML.indexOf('&lt;') == -1) {<br \/>\n       document.getElementById('fcommand').value=document.getElementById('fcommand').value.replace(' inva.mp4 ', ' ' + document.getElementById('scbix').innerHTML + ' ');<br \/>\n     }<br \/>\n     if (document.getElementById('moreb').innerText.indexOf(' -c ') != -1 && document.getElementById('fcommand').value.indexOf(' -c ') != -1) {<br \/>\n      if (document.getElementById('moreb').innerText.split(' -c ')[1] != document.getElementById('fcommand').value.split(' -c ')[1]) {<br \/>\n       document.getElementById('fcommand').value=document.getElementById('fcommand').value.split(' -c ')[0] + ' -c ' + document.getElementById('moreb').innerText.split(' -c ')[1];<br \/>\n      }<br \/>\n     }<br \/>\n     return true;<br \/>\n  }<\/font><br \/>\n<\/code><br \/>\n&#8220;; ?&gt;<\/p>\n<p> &#8230; reign supreme collecting their media file specification information in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/voiceover.php-GETME\">the changed<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/voiceover.php-GETME\">voiceover.php<\/a> PHP (we&#8217;d want you to download to a local <a target=_blank title='MAMP' href='http:\/\/www.mamp.info'>MAMP<\/a> Apache web server&#8217;s Document Root folder) and which you can <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/voiceover.php\">run that PHP there<\/a>.<\/p>\n<p>The previous work of <a target=_blank href='https:\/\/www.rjmprogramming.com.au\/ITblog\/animated-gif-creation-install-paths-tutorial\/' title='Animated GIF Creation Install Paths Tutorial'>Animated GIF Creation Install Paths Tutorial<\/a>&#8216;s thread of blog postings has been a great help with this ffmpeg &#8220;Intranet feeling&#8221; integration work we use, around here, in conjunction with macOS or Windows operating system <a target=_blank title='MAMP' href='http:\/\/www.mamp.info'>MAMP<\/a> Apache local web server environments.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=_blank  href='\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-mux-video-and-audio-media-browsing-tutorial\/'>Ffmpeg Mux Video and Audio Media Browsing Tutorial<\/a>.<\/p-->\n<hr>\n<p id='fmvapt'>Previous relevant <a target=_blank title='Ffmpeg Mux Video and Audio Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-mux-video-and-audio-primer-tutorial\/'>Ffmpeg Mux Video and Audio Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/voiceover.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Ffmpeg Mux Video and Audio Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/voiceover.jpg\" title=\"Ffmpeg Mux Video and Audio Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Ffmpeg Mux Video and Audio Primer Tutorial<\/p><\/div>\n<p>We&#8217;ve got another &#8220;Intranet feeling&#8221; PHP web application  &#8220;first draft&#8221; for you today.  The reason we&#8217;re opting for &#8220;Intranet feeling&#8221; (ie. we&#8217;re asking you to download the <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/voiceover.php_GETME\">voiceover.php<\/a> PHP to a local <a target=_blank title='MAMP' href='http:\/\/www.mamp.info'>MAMP<\/a> Apache web server and <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/voiceover.php\">run the PHP there<\/a> from its Document Root folder) is that we want to further explore the brilliant &#8230;<\/p>\n<p><code><br \/>\n<a target=_blank title='ffmpeg' href='https:\/\/www.ffmpeg.org\/'>ffmpeg<\/a> -i inv.mp4 -i inva.mp4 -c copy -map 0:v:0 -map 1:a:0 -shortest out.mp4<br \/>\n<\/code><\/p>\n<p> &#8230; we got inspired to try via <a target=_blank href='https:\/\/gist.github.com\/steven2358\/ba153c642fe2bb1e47485962df07c730'>Mux Video and Audio from another Video<\/a> and <a target=_blank href='https:\/\/stackoverflow.com\/questions\/12938581\/ffmpeg-mux-video-and-audio-from-another-video-mapping-issue'>FFMPEG mux video and audio (from another video) &#8211; mapping issue<\/a> &#8230; thanks and thanks &#8230; to add audio to a video stream from two different sources.<\/p>\n<p>At least, with macOS MAMP there is the excellent command line <a target=_blank title='macOS file command' href='https:\/\/ss64.com\/osx\/file.html'>&#8220;file&#8221;<\/a> we can use to show information about some potential input files you could use in this, so far, user unfriendly, &#8220;first draft&#8221; version of the PHP.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d59397' onclick='var dv=document.getElementById(\"d59397\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/video\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d59397' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d59407' onclick='var dv=document.getElementById(\"d59407\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/ffmpeg\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d59407' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Onto yesterday&#8217;s Ffmpeg Mux Video and Audio Primer Tutorial &#8230; There be a flowerin&#8217; of inner warmth and glo&#8217; towards all our readers, youngins and oldins alike &#8230; like! Yes, we&#8217;re involving good ol&#8217; HTML5 File API Object Javascript logic, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-mux-video-and-audio-media-browsing-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[84,85,113,1993,3531,174,233,234,2442,342,1750,360,415,418,419,452,576,578,587,611,614,624,714,744,760,4341,3987,870,1712,894,932,997,1168,1262,1319,1369],"class_list":["post-59407","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-animation-2","tag-apache","tag-audio","tag-browse","tag-browsing","tag-button","tag-command","tag-command-line","tag-contenteditable","tag-div","tag-document-root","tag-download","tag-ffmpeg","tag-file","tag-file-api","tag-form","tag-html","tag-html5","tag-iframe","tag-install","tag-integration","tag-intranet","tag-local-web-server","tag-mamp","tag-media","tag-mux","tag-oncontextmenu","tag-onload","tag-onsubmit","tag-overlay","tag-php","tag-programming","tag-software-integration","tag-textarea","tag-tutorial","tag-video"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/59407"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=59407"}],"version-history":[{"count":13,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/59407\/revisions"}],"predecessor-version":[{"id":59432,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/59407\/revisions\/59432"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=59407"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=59407"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=59407"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}