TransWikia.com

Find duration only with ffprobe in Windows

Video Production Asked by K7AAY on November 16, 2021

I want to find video file duration only with ffprobe but

ffprobe FILENAME.EXT 2| find "Duration:" 

does not filter output to show just the line with "Duration:" Instead, I got:

Argument ‘2’ provided as input filename, but ‘FILENAME.MP4’ was
already specified.

How do I see just the duration of a file from the Windows command prompt?

One Answer

First, if you just want information about a file, you should probably use "ffprobe", not "ffmpeg". Otherwise you'll get an answer, but you'll also have an error return status.

As to your real question: By convention, ffmpeg reserves STDOUT for binary video and audio data only. Everything else, including all the possible kinds of informative text, is sent to STDERR.

So, try changing your code to:

ffprobe FILENAME.EXT 2| find "Duration:" (for a *nix shell)

or

ffprobe.exe FILENAME.EXT 2>&1 | findstr Duration (for a Windows shell)

Answered by garryw on November 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP