Fedora Linux Support Community & Resources Center
  #1  
Old 18th October 2007, 03:40 PM
HaydnH Offline
Registered User
 
Join Date: Feb 2005
Location: London, UK
Posts: 333
ffmpeg shell script help

Hi All,

I know this isn't really the correct forum to post this to, but I can't seem to find any active ffmpeg forums... and at least I'm a fedora user

I'm currently writing a shell script that converts video files to mp4 with h264 encoding for use with a media player. The script runs the following command:

ffmpeg -y -i "$FILE" -f mp4 -vcodec h264 "$FILENAME.mpg" 2>> $LOGFILE

However, I need a way of checking if the conversion has been successful. Annoyingly ALL output from ffmpeg goes to stderr (cheers devs!) so I can't just check if stderr contains anything, there's no "successful" string on completion and I don't really want to test for every possible error message. Any ideas?

BTW, I don't mind using a different conversion tool as long as it supports mp4/h264 and doesn't require too many libraries.

Haydn.
Reply With Quote
  #2  
Old 18th October 2007, 03:58 PM
.:neogeo:. Offline
Registered User
 
Join Date: Feb 2006
Posts: 49
hey,

Just a couple of ideas that might help you with your script. You could...

1. test the bash $? after you execute ffmpeg -y -i "$FILE" -f mp4 -vcodec h264 "$FILENAME.mpg" 2>> $LOGFILE for its return status. when $? = 0 then success or $? = 1 failure

2. or maybe test if the output file exists on the filesystem and/or if the file exists test if the file size is greater than 0 bytes

Hope that helps
Reply With Quote
  #3  
Old 18th October 2007, 04:05 PM
HaydnH Offline
Registered User
 
Join Date: Feb 2005
Location: London, UK
Posts: 333
It's a ksh script but $? still works in ksh. Hopefully ffmpeg returns proper return codes, if not the file size idea is a good one!

Thanks,

Haydn.
Reply With Quote
Reply

Tags
ffmpeg, script, shell

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
call remote shell script within an expect script PhillyFloyd Programming & Packaging 2 16th October 2007 10:29 PM
starting a shell script inside a php script gw348 Using Fedora 6 23rd April 2007 09:30 PM
shell script Wangberg Programming & Packaging 13 4th April 2007 04:48 PM
need to run script Bourne-shell script armen Using Fedora 4 4th April 2005 01:16 PM
Shell script ieuuk Programming & Packaging 5 28th October 2004 10:51 PM


Current GMT-time: 08:26 (Thursday, 02-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat