[FFmpeg-user] ffmpeg command line issue

Ned Rockson nedrocks at gmail.com
Fri Dec 11 04:38:52 CET 2015


I think it depends on what you mean by fail. If you are looking to see if
the command exited with a non-zero exit status (generally best way to
detect failure) then you can look at the return code ($? gets the last
command's return code in bash).

If you need to have a more granular description of failure, you should look
at your output file ($pcmaudioname) to see if it exists and contains the
content you want (using something like ffprobe).

You could also set the log verbosity to ffmpeg to be extremely high and
then see whether anything logged which would be a good indication something
is wrong.

Best,
Ned

On Tue, Dec 8, 2015 at 9:44 PM, 王知践 <zhihjian.wang at gmail.com> wrote:

> hi,
> I want to execute this command `ffmpeg -i $videoname -y -ar 16000 -ac 1 -f
> s16le -acodec pcm_s16le $pcmaudioname` on my shell scripts. And if it
> failed, i run command `ffmpeg -i $videoname -y -ar 8000 -ac 1 -f s16le
> -acodec pcm_s16le $pcmaudioname`.
> I don't known how to check command  `ffmpeg -i $videoname -y -ar 16000 -ac
> 1 -f s16le -acodec pcm_s16le $pcmaudioname` failed or success.
>
> Thank you
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>



-- 
Ned Rockson
m: +1 415 580 0074 | @nedrockson


More information about the ffmpeg-user mailing list