I'm looking for a way to get only the lines that contains a specified word, in this case all lines that contains the word Stream from an output
I've tried;
streams=$(ffprobe -i "movie.mp4" | grep "Stream")
but that didn't get any results..
or do I need to output it to a file and then try to extract the lines I'm looking for?
@paulsm4 was spot on ... the output goes to STDERR.
streams=$(ffprobe -i "movie.mp4" |& grep "Stream")
Note the &
No need for grep
. Just use ffprobe
directly to get whatever info you need.
ffprobe -loglevel error -show_format -show_streams input.mp4
ffprobe -loglevel error -show_streams -select_streams v input.mp4
ffprobe -loglevel error -show_streams -select_streams a input.mp4
See Getting video dimension / resolution / width x height from ffmpeg
See How to get video duration?
See Get video frames information with ffmpeg
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.