Search code examples
cmdffmpeg

finding bitrate of videos using ffmpeg


I have some mp4 videos in a folder and I need to find the bitrate of each file and save them in a file. I have this cmandline code:

find . -name "*.mkv" -print0 | xargs -0 -i{} sh -c " echo -n '{} ' && ffmpeg -i '{}' 2>&1 | sed -n -e 's/^.*bitrate: //p' " > result.txt

but I am working in windows and it produces this error:

'xargs' is not recognized as an internal or external command,
operable program or batch file.

do you know what is the equivalent command code in windows?


Solution

  • With ffprobe (included with ffmpeg), use the following command:

    ffprobe -v error -print_format json -show_entries stream=bit_rate input.mp4>output.json
    

    This will put the output into a json file and put the bitrate of all streams of the file. These are usually the bitrates for video and audio, but would also show bitrates of subtitle tracks and possibly other audio tracks.