Image/PDF and Audio/Video Supervised Flatten Tutorial
โœ‚๐Ÿƒ๐Ÿพโ€โ™€๏ธ๐Ÿƒ๐Ÿผโ€โ™‚๏ธ
๐Ÿ“–

Image/PDF and Audio/Video Supervised Flatten Tutorial

Image/PDF and Audio/Video Supervised Flatten Tutorial

Yesterdayโ€™s Image/PDF and Audio/Video Supervised Concatenate Tutorialโ€˜s โ€ฆ

  • โ€œ+โ€ functionality to โ€ฆ
    1. concatenate โ€ฆ or โ€ฆ
    2. voiceover

    โ€ฆ is, today, joined by โ€ฆ you guessed it โ€ฆ

  • โ€œ-โ€ functionality to โ€ฆ
    1. flatten animated GIF โ€ฆ or โ€ฆ
    2. flatten video

    โ€ฆ out to constituent image slides โ€ฆ because we figure there are scenarios where a user wants โ€ฆ

    • one input media file โ€ฆ to end up as โ€ฆ
    • several output media files

So far no sanity checks are made regarding how many image slides ffmpeg will create via our โ€ -r 1 โ€ switch โ€ฆ



$switchtwo="";

if (isset($_GET['flattenit'])) {

if (str_replace("false","",$_GET['flattenit']) != "") {

$switchtwo=" -r 1 ";

}

} else if (isset($_POST['flattenit'])) {

if (str_replace("false","",$_POST['flattenit']) != "") {

$switchtwo=" -r 1 ";

}

}

โ€ฆ applied to output one image slide per second (sample rate) of video input. But perhaps you โ€œdoing the Mathโ€ would explain why we donโ€™t want this functionality up at the rjmprogramming.com.au domain web server, though Usain Bolt would only trouble us with 11 image slides for his lightning fast 100 meter sprints!

Thanks to this link regarding Filmstrip CSS ideas.

Here again is thechanged macos_ffmpeg_convertโšซphp PHP code to a place suitable to work it into the use of a PHP (perhaps Apache) local web server product such as MAMP should we be catching your attention yet!



Previous relevant Image/PDF and Audio/Video Supervised Concatenate Tutorial is shown below.

Image/PDF and Audio/Video Supervised Concatenate Tutorial

Image/PDF and Audio/Video Supervised Concatenate Tutorial

It is a combination of โ€ฆ

โ€ฆ that steers us into another couple of ideas our โ€œ+โ€ logics could represent when we are talking about media, those being โ€ฆ

  • concatenate audio or concatenate video โ€ฆ ie. string one media file onto another to achieve a final media file result
  • add voiceover audio content(s) onto video(s)

โ€ฆ all using the talents of the brilliant Open Source ffmpeg audio and/or video media editor and manager and creator.

The conduit we use to make these media manipulations happen revolves around a Javascript Ajax and FormData object logic solution with (PHP writing Javascript) code like (where $verb points to where ffmpeg resides and infs[] array contains input media file files (with no path)) โ€ฆ

<?php
echo โ€


var concatbit='\"concat:';

var xzhr = new XMLHttpRequest();

var xform=new FormData();

for (jut=0; jut<infs.length; jut++) {

xform.append('command' + jut, '" . $verb . " -i ' + document.getElementById('path').value + infs[jut] + ' ' + document.getElementById('path').value + infs[jut].split('.')[0] + '.ts < /tmp/macos.yes');

if (concatbit.indexOf('.ts') == -1) {

concatbit+=document.getElementById('path').value + infs[jut].split('.')[0] + '.ts';

} else {

concatbit+='|' + document.getElementById('path').value + infs[jut].split('.')[0] + '.ts';

}

}

xform.append('command' + infs.length, '" . $verb . " -i ' + concatbit + '\" -c copy ' + document.getElementById('opath').value + document.getElementById('outputname').value.split('.')[0] + '_0.ts < /tmp/macos.yes');

var isofar=eval('' + infs.length);

isofar++;

xform.append('command' + isofar, '" . $verb . " -i ' + document.getElementById('opath').value + document.getElementById('outputname').value.split('.')[0] + '_0.ts ' + document.getElementById('opath').value + document.getElementById('outputname').value + ' < /tmp/macos.yes');

for (jut=0; jut<infs.length; jut++) {

isofar++;

xform.append('command' + isofar, 'rm -f ' + infs[jut].split('.')[0] + '.ts < /tmp/macos.yes');

}

isofar++;

xform.append('command' + isofar, 'rm -f ' + document.getElementById('opath').value + document.getElementById('outputname').value.split('.')[0] + '_0.ts < /tmp/macos.yes');

isofar++;

xform.append('command' + isofar, 'open ' + document.getElementById('outputname').value);

xzhr.open('post', document.URL.split('?')[0].split('#')[0], true);

xzhr.send(xform);


โ€œ;
?>

Here is thechanged macos_ffmpeg_convertโšซphp PHP code to a place suitable to work it into the use of a PHP (perhaps Apache) local web server product such as MAMP.


Previous relevant Image/PDF and Audio/Video Supervised Multiple Tutorial is shown below.

Image/PDF and Audio/Video Supervised Multiple Tutorial

Image/PDF and Audio/Video Supervised Multiple Tutorial

Back at Image/PDF and Audio/Video Supervised Aesthetics Tutorial we had an assumption going that there would be a one to one correspondence of โ€ฆ

  • input media file โ€ฆ to โ€ฆ
  • output media file

โ€ฆ but there are quite a few scenarios where a user wants โ€ฆ

  • several input media files โ€ฆ to end up as โ€ฆ
  • one output media file

โ€ฆ and today we cater for โ€ฆ

  • several input image media files โ€ฆ to end up as โ€ฆ
    1. one output animated GIF
    2. one output video
    3. one output PDF

โ€ฆ with more ideas to be tackled in days to come, based on the user involving a โ€œ+โ€ character in their Input Media Textbox entries. Then it is likely that the user will browse for multiple local computer files as per โ€ฆ



<input type=file accept=".pdf,image/*,video/*,audio/*" capture multiple></input>

For today, here is thechanged macos_ffmpeg_convertโšซphp PHP code to a place suitable to work it into the use of a PHP (perhaps Apache) local web server product such as MAMP and helped out by thechanged tutorial_to_animated_gifโšซphp animated GIF creator web application, or just use the Email functionality via liveโœ‚run link.


Previous relevant Image/PDF and Audio/Video Supervised Aesthetics Tutorial is shown below.

Image/PDF and Audio/Video Supervised Aesthetics Tutorial

Image/PDF and Audio/Video Supervised Aesthetics Tutorial

That work of yesterdayโ€™s โ€ฆ

  • Button Versus Input Type Equals Button Primer Tutorialโ€˜s button element improved approach to working with email addresses in consort with window.localStorage โ€œmemoryโ€ (even between sessions) โ€ฆ combines with โ€ฆ
  • the recent work of Image/PDF and Audio/Video Supervised Conversions Tutorial โ€ฆ โ€œsprinkled withโ€ โ€ฆ
  • some CSS aesthetic improvements โ€ฆ


    <style>

    input[type=text] { background-color: #f0f0f0; border-radius: 5px; }

    input[type=submit] { font-size: 18px; border-radius: 20px; }

    button { font-size: 18px; border-radius: 20px; }

    div[contenteditable=true] { font-size: 14px; border-radius: 5px; }

    table { border-radius: 25px; }

    </style>


    โ€ฆ add onto various bits of inline CSS styling such as โ€ฆ


    <body style="background: linear-gradient(to left, #ffffff 20%, #ffefba 80%); ">


    โ€ฆ and โ€ฆ
  • some mobile platform functionality and emoji display improvements

โ€ฆ to give a bit of a makeover to our โ€œMediaโ€ conversions web application, today.

Why emojis (as such) regarding โ€œmobileโ€ (platforms only)? Well, there is a โ€œbehind the scenesโ€ dual purpose side to this web application on โ€œmobileโ€ platforms for two reasons โ€ฆ

  1. โ€œmobileโ€ platforms do not support our ffmpeg nor ImageMagick conversion โ€œhelpersโ€ โ€ฆ and โ€ฆ
  2. called โ€œcaptureโ€ attribute of the called Local File Browsing opens the door to a user capturing their media via their smart device, and the natural urge here to share via email

โ€ฆ are both reasons the web application might be more apt for your โ€œmobileโ€ users to take a photo (we use emoji &#129331; ๐Ÿคณ) and then email (we use emoji &#128231; ๐Ÿ“ง) and remind the user of this possibility, because their gaze is quite likely to fall onto these two emoji concepts on the screen. Meanwhile, in the code, weโ€™ve tweaked things so that the conversion half of the web applicationโ€™s functionality is not essential, but leave the โ€œoutputโ€ half of the web application in even for โ€œmobileโ€ users because a web application is what it is, for a user to work it as they will.

And what of the โ€œcommand lineโ€ PHP โ€œmode of useโ€ for this web application? Well, we recommend you download and use thecloned convert_audiovideo_pleaseโšซksh Korn Shell script that can be a โ€œlistenerโ€ for downloaded media off those email attachments (sent to emailees). You could execute this โ€œlistenerโ€ as a macOS or Linux backup process via โ€ฆ



ksh convert_audiovideo_please.ksh &

And so, here is thechanged macos_ffmpeg_convertโšซphp PHP code to a place suitable to work it into the use of a PHP (perhaps Apache) local web server product such as MAMP or just use the Email functionality via liveโœ‚run link.

Also for the Document Conversion web application that makeover is very similar whereby thechanged macos_textutil_convertโšซphp PHP code to a place suitable to work it into the use of a PHP (perhaps Apache) local web server product such as MAMP or just use the Email functionality via Documentโœ‚Conversion live run link.


Previous relevant Audio and Video Supervised Conversions Primer Tutorial is shown below.

Audio and Video Supervised Conversions Primer Tutorial

Audio and Video Supervised Conversions Primer Tutorial

Were you here, or remember, the blog posting called MacOS Document Conversion Primer Tutorial, when we surmised โ€ฆ

A good thing about a โ€œversion controlโ€ or โ€œsource controlโ€ system is that you can โ€ฆ

  • โ€œpick upโ€ from any version โ€ฆ
  • โ€œcloneโ€ to another name โ€ฆ
  • โ€œbranch offโ€ immediately into a new version โ€ฆ

โ€ฆ to effectively โ€œcloneโ€ the suitable progress point from a previous project as the start to a new project.

โ€ฆ ? Well, yesterdayโ€™s Pandoc Document Conversion Email Tutorial felt like another such โ€œcloningโ€ possibility, as it felt like a โ€œprogress pointโ€ (to me and Nala). Such โ€œcloningโ€, to our mind, is a bit โ€œover the topโ€ if there is no good reason. But we think there is. Lately, weโ€™ve been developing โ€œDocumentโ€ conversion software. In Information Technology, under the banner of โ€œdocument processingโ€, that work is of interest. Another area of Information Technology software concerns media โ€ฆ to us, that being โ€ฆ

  • image
  • audio
  • video

โ€ฆ and it is in this โ€œMediaโ€ field, starting out with just (the) โ€œaudio and videoโ€ (options) above, we feel weโ€™d like to start developing โ€œMediaโ€ conversion software, because we know of a brilliant Open Source suite of software called ffmpeg that we want to work with here. Though you might say we are โ€œthe hangers onersโ€ in this arrangement, it is true in a lot of lifeโ€™s work that getting to the smart stuff is not as easy as youโ€™d think, and the better you can arrange it, the more efficient will the users of all this software feel.

Youโ€™ll notice with our blog posting title there being no mention of macOS or Mac OS X today. Yes, todayโ€™s โ€œmediaโ€ helper is Open Source across operating systems and we so far are not checking that you have installed ffmpeg or not. For now, it is a โ€œsuck it and seeโ€ approach. But we do not want to install ffmpeg up at our public rjmprogramming.com.au domain web server, and so we write this โ€œMedia Conversionโ€ software with the thinking that on your local computer you may install ffmpeg and find it then useful to download thecloned macos_ffmpeg_convertโšซphp PHP code to a place suitable to work it into the use of a PHP (perhaps Apache) local web server product such as MAMP. This PHP calls on our File API friend, achanged client_browsingโšซhtm local file browser web application.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in Ajax, Animation, eLearning, Event-Driven Programming, Operating System, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *