Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

Returning compressing error codes

Discussions about problems encountered using ffmpeg.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

Returning compressing error codes

Postby filipe.silva » Wed Apr 12, 2017 9:37 am

Heloo everyone.
Im creating a script in powershell with ffmpeg to compress over 2tb of videos, and i have a question.
Is it possible to get the process of converting a video to return an error code if it fails to convert? This is very important for me.


Thanks!
Last edited by filipe.silva on Wed Apr 12, 2017 2:24 pm, edited 1 time in total.
filipe.silva
 
Posts: 4
Joined: Wed Apr 12, 2017 9:32 am

Re: Returning compressing error codes

Postby filipe.silva » Wed Apr 12, 2017 4:32 pm

Im despairing for an answer :O
filipe.silva
 
Posts: 4
Joined: Wed Apr 12, 2017 9:32 am

Re: Returning compressing error codes

Postby mulvya » Wed Apr 12, 2017 4:40 pm

FFmpeg should set error code to 1 if conversion fails. You can also try adding -xerror.
mulvya
 
Posts: 565
Joined: Mon Oct 26, 2015 6:58 am

Re: Returning compressing error codes

Postby filipe.silva » Thu Apr 13, 2017 8:36 am

mulvya wrote:FFmpeg should set error code to 1 if conversion fails. You can also try adding -xerror.


Thanks for your reply!
where does the error return? What i need is something like this:
Code: Select all
$error = C:\ffmpeg\bin\ffmpeg.exe -i $inputDir -s -xerror 720x480 -b 512k -vcodec mpeg1video -acodec copy $outputDir
$errorCode >> "log.txt"
If ($error -eq 0)
{
   $error = C:\ffmpeg\bin\ffmpeg.exe -v error -i $outputDir -f null - >>"log.txt" 2>&1
}
      
if ($error -eq 1)
{
   Write-Host "The application found an error, please check the error.log `n Please press any key to leave"
   $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
   exit
}
filipe.silva
 
Posts: 4
Joined: Wed Apr 12, 2017 9:32 am

Re: Returning compressing error codes

Postby filipe.silva » Thu Apr 13, 2017 4:23 pm

I found out that ffmpeg return the error to "$?" ! Is there another variable that i'm anware?
Is there a way to pass the compression error to a log file?
filipe.silva
 
Posts: 4
Joined: Wed Apr 12, 2017 9:32 am


Return to ffmpeg

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 9 guests