Thread: Tech FFmpeg duration
View Single Post
Old 10-27-2017, 10:55 AM  
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
If you are working with a PHP Iron Cube or similar script encoding you are working with one hand tied behind your back.

I think you will need to do this in bash outside of your encoded script. Just work one level above your video directory(s)

Code:
find . "*.mpg*"
Make a .csv of that output
then loop the files in a bash variable
do the commands.

it is trivial to loop twice
only the time to read and do the conversion.
if you have to; make a second .csv with the filepath, time just cut -d',' -f? < assign the field variables
then loop that file and watermark I guess.

You don't need PHP to do this that is like pounding a nail with a pile driver. It will take 2 days to set up the pile driver then you will bend the nail. PHP is a interpreter language. As soon as you start doing system commands in PHP other than for something trivial you will make a mess.
Code:
php  script.php
^^ works well in .sh (bash) scripts (cli) we are doing system work with ffmpeg. Use the right tool for the job rather than spend lots of time making what you know best work.

Oh, and PHP json_encode; _decode; is good for many things. I am using it a lot these days but for its intended purpose ... JSON Use the right tool ...
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote