Thread: Tech FFmpeg duration
View Single Post
Old 10-25-2017, 01:36 PM  
mikeworks
Confirmed User
 
Join Date: Apr 2010
Posts: 272
Thanks guys, with current encoded script I have found another solution that almost works.

If I paste this into command line it works:
Code:
eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=duration /path/to/file/1.mp4) duration=${streams_stream_0_duration}

/usr/local/bin/ffmpeg -i '/path/to/file/1.mp4' -vf 'scale=448:trunc(ow/a/vsub)*vsub' -vf drawtext="fontsize=16:[email protected]:fontfile=/usr/local/share/fonts/freefont-ttf/FreeSans.ttf:text='Blah blah blah':y=25:x=w-(t-($duration/2))*w/20" -threads 0 -acodec libfaac -ar 44100 -ab 128k -vcodec libx264 -preset slower -keyint_min 25 -g 250 -r 25 -y /path/to/output/file/temp_vid.mp4
Note the line break between the ffprobe and ffmpeg commands.

Now, when I save this in the database of encoded script (only way to use command), it removes that line ending up like this:

Code:
eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=duration /path/to/file/1.mp4) duration=${streams_stream_0_duration} /usr/local/bin/ffmpeg -i '/path/to/file/1.mp4' -vf 'scale=448:trunc(ow/a/vsub)*vsub' -vf drawtext="fontsize=16:[email protected]:fontfile=/usr/local/share/fonts/freefont-ttf/FreeSans.ttf:text='Blah blah blah':y=25:x=w-(t-($duration/2))*w/20" -threads 0 -acodec libfaac -ar 44100 -ab 128k -vcodec libx264 -preset slower -keyint_min 25 -g 250 -r 25 -y /path/to/output/file/temp_vid.mp4
Without the line break, command line reports this error:

Syntax error: "(" unexpected

Is there any way to save into the database and maintain the important line break between the ffprobe and ffmpeg command?
mikeworks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote