{"id":64501,"date":"2024-08-25T03:01:00","date_gmt":"2024-08-24T17:01:00","guid":{"rendered":"https:\/\/65.254.95.247\/ITblog\/?p=64501"},"modified":"2024-08-25T08:48:42","modified_gmt":"2024-08-24T22:48:42","slug":"ffmpeg-user-defined-video-editing-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-user-defined-video-editing-tutorial\/","title":{"rendered":"Ffmpeg User Defined Video Editing Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/PHP\/tmp_ffmpeg.php\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Ffmpeg User Defined Video Editing Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/ffmpeg\/ffmpeg_user_defined.gif\" title=\"Ffmpeg User Defined Video Editing Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Ffmpeg User Defined Video Editing Tutorial<\/p><\/div>\n<p>Today we&#8217;re combining video contents from &#8230;<\/p>\n<ul>\n<li>yesterday&#8217;s <a title='Ffmpeg Helps iPhone Video to YouTube Tutorial' href='#fhpvytt'>Ffmpeg Helps iPhone Video to YouTube Tutorial<\/a> &#8230; with &#8230;<\/li>\n<li>our newly created public interface to <a target=\"_blank\" title='ffmpeg' href='https:\/\/www.ffmpeg.org\/' rel=\"noopener\">ffmpeg<\/a> with the &#8220;soon to be DNS version of rjmprogramming.com.au <font size=1>&#8230; but not yet<\/font>&#8221; AlmaLinux Apache\/PHP\/MySql web server install we talked about at <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-install-and-public-face-tutorial\/' title='Ffmpeg Install and Public Face Tutorial' rel=\"noopener\">Ffmpeg Install and Public Face Tutorial<\/a> &#8230; and &#8230;<\/li>\n<li>IP address redirecting, as needed, <i>ifconfig<\/i> (via PHP shell_exec and $_SERVER[&#8216;SERVER_ADDR&#8217;]) based logic &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n  $whereplace=shell_exec(\"ifconfig | grep -Eo 'inet (addr:)?([0-9]*\\.){3}[0-9]*' | grep -Eo '([0-9]*\\.){3}[0-9]*' | grep -v '127.0.0.1'\");<br \/>\n  if (strpos(($whereplace . ' ' . $_SERVER['SERVER_ADDR']), '65.254.92.213') !== false) {<br \/>\n     $sv='\/usr\/bin\/ffmpeg';<br \/>\n     header('Location: https:\/\/65.254.95.247\/PHP\/tmp_ffmpeg.php'); \/\/$smallpath='https:\/\/65.254.95.247\/PHP\/'; \/\/header('Location: https:\/\/65.254.95.247\/PHP\/tmp_ffmpeg.php');<br \/>\n     exit; \/\/exit;<br \/>\n  }<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; we talked about at <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-landing-page-wordpress-content-update-solution-tutorial\/' title='AlmaLinux Landing Page WordPress Content Update Solution Tutorial' rel=\"noopener\">AlmaLinux Landing Page WordPress Content Update Solution Tutorial<\/a> &#8230; as well as &#8230;<\/li>\n<li>user definable form navigation &#8230; using &#8230;<\/li>\n<li>optional dropdown ideas incorporating ideas from <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/sepia-video-via-ffmpeg-primer-tutorial\/' title='Sepia Video via ffmpeg Primer Tutorial' rel=\"noopener\">Sepia Video via ffmpeg Primer Tutorial<\/a> &#8230; and using &#8230;<\/li>\n<li>temporary storage places to place output video &#8230; and making use of &#8230;<\/li>\n<li>soft links regarding URLs we talked about at <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/linux-web-server-soft-link-url-tutorial\/' title='Linux Web Server Soft Link URL Tutorial' rel=\"noopener\">Linux Web Server Soft Link URL Tutorial<\/a> (saving us having to use <i>&#8216;data:video\/mp4;base64,&#8217; . base64_encode(file_get_contents(trim($endout)))<\/i> style PHP interventions <font size=1>(which were testing friendships)<\/font>)<\/li>\n<\/ul>\n<p> &#8230; to start down this road towards <i>public facing<\/i> ffmpeg video editing around here <font size=1>(which we have been hankering for for several years now)<\/font>.<\/p>\n<p>In this <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/PHP\/tmp_ffmpeg.php_GETME\" rel=\"noopener\">first draft<\/a> of <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/PHP\/tmp_ffmpeg.php\" rel=\"noopener\">Your Own Ffmpeg Video Changes<\/a> (via command line ffmpeg) we&#8217;re really buttoning down <font size=1>(via not allowing the forward slash character in amongst the user defined ffmpeg command <i>innards<\/i>)<\/font> what happens regarding &#8230;<\/p>\n<ul>\n<li>output video file source location &#8230; and &#8230;<\/li>\n<li>input video file source &#8230;<br \/>\n<video style=width:98%; controls><source type=video\/mp4 src='http:\/\/www.rjmprogramming.com.au\/ffmpeg\/govetts_leap.mp4'><\/source><\/video>\n<\/li>\n<\/ul>\n<p> &#8230; but <a target=\"_blank\" title='?' href='https:\/\/www.youtube.com\/watch?v=sYOUFGfK4bU' rel=\"noopener\">who<\/a> knows what the future holds?!  <\/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-helps-iphone-video-to-youtube-tutorial\/' rel=\"noopener\">Ffmpeg Helps iPhone Video to YouTube Tutorial<\/a>.<\/p-->\n<hr>\n<p id='fhpvytt'>Previous relevant <a target=\"_blank\" title='Ffmpeg Helps iPhone Video to YouTube Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-helps-iphone-video-to-youtube-tutorial\/' rel=\"noopener\">Ffmpeg Helps iPhone Video to YouTube Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.youtube.com\/watch?v=KB_2V-WW5ss\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Ffmpeg Helps iPhone Video to YouTube Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/ffmpeg\/ffmpeg_to_youtube.gif\" title=\"Ffmpeg Helps iPhone Video to YouTube Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Ffmpeg Helps iPhone Video to YouTube Tutorial<\/p><\/div>\n<p>Today we recorded a video looking out from Govetts Leap, Blackheath, here in the Blue Mountains.  We captured it via the Camera app on an iPhone via its Video option.<\/p>\n<p>Nineteen seconds long, to share to this MacBook Air we needed AirDrop, the size of it precluding us from using the Photo app&#8217;s Mail sharing option.<\/p>\n<p>And that&#8217;s where we wanted to use the great <a target=\"_blank\" title='ffmpeg' href='https:\/\/www.ffmpeg.org\/' rel=\"noopener\">ffmpeg<\/a> in an optimal way to create a video that we could upload to YouTube.  In this, we arrived at <a target=\"_blank\" title='Excellent link, thanks' href='https:\/\/www.reddit.com\/r\/ffmpeg\/comments\/r1qwyy\/best_streaming_settings_for_youtube\/' rel=\"noopener\">this excellent link<\/a> getting us to try &#8230;<\/p>\n<p><code><br \/>\nffmpeg -i govetts_leap.MOV -c:v libx264 -preset slow -crf 18 -vf scale=out_color_matrix=bt709 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -c:a aac -ar 48000 -ac 2 -b:a 320k -profile:v high -level 4.0 -bf 2 -coder 1 -pix_fmt yuv420p -b:v 10M -threads 4 -cpu-used 0 -r 30 -g 15 -movflags +faststart govetts_leap.mp4<br \/>\n<\/code><\/p>\n<p> &#8230; with success.  Checking with <a target=\"_blank\" title='Another great link, thanks' href='https:\/\/www.maestro.io\/blog\/video-formats\/' rel=\"noopener\">this other excellent link<\/a>, thanks, we were comforted that they would have recommended an output mp4 file format as well, it seems &#8230;<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/KB_2V-WW5ss?si=IoTDBSVk7R6uyDfX\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe> <\/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='#d64630' onclick='var dv=document.getElementById(\"d64630\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/youtube\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d64630' 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='#d64501' onclick='var dv=document.getElementById(\"d64501\"); 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='d64501' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today we&#8217;re combining video contents from &#8230; yesterday&#8217;s Ffmpeg Helps iPhone Video to YouTube Tutorial &#8230; with &#8230; our newly created public interface to ffmpeg with the &#8220;soon to be DNS version of rjmprogramming.com.au &#8230; but not yet&#8221; AlmaLinux Apache\/PHP\/MySql &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-user-defined-video-editing-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,29,33],"tags":[152,234,415,452,4884,932,997,2293,3942,3883,1231,1319,1369,3230],"class_list":["post-64501","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-operating-system","category-software","tag-blur","tag-command-line","tag-ffmpeg","tag-form","tag-guassian-blue","tag-php","tag-programming","tag-sepia","tag-shell_exec","tag-switch","tag-switches","tag-tutorial","tag-video","tag-video-editor"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64501"}],"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=64501"}],"version-history":[{"count":4,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64501\/revisions"}],"predecessor-version":[{"id":64507,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64501\/revisions\/64507"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=64501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=64501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=64501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}