[FFmpeg-user] ffprobe output for wmf/wtv files

Ted Park kumowoon1025 at gmail.com
Thu Jul 25 10:24:03 EEST 2019


> Question 1--  I am interested in gleaning only three fields
> 
> *Input*
> 
> *WM/SubTitleDescription*
> 
> *WM/MediaOriginalRunTime*
You can use the -show_entries option to limit the information you get. The Input part is messy though, it isn’t part of the output of the ffprobe tool, but if all you need is the file name, you can get that through the format metadata. For starters, try using -show entries “format=filename:stream_tags=WM/SubTitleDescription,WM/MediaOriginalRunTime"

> Question 2--  I also require that these fields be output as a single (long)
> line with the fields separated by  ‘|’ character. It would be helpful if
> the RunTime duration be in terms of minutes rather than milliseconds.

The closest thing would be the “compact” writer, I think. You can customize the output format by adding -of compact=p=0, or -of compact=p=0:nk=1 if you don’t want the field names to be part of the output. And add 2>&- at the end to close the standard error stream, which I think is what you want.

But the metadata comes from different parts of the output (format and stream_tag) so they would be on separate lines, with no pipe character to separate them. The easiest thing to do would be to use sed on the output imo.

As for the duration being in minutes rather than milliseconds, you’re going to have to use some other tool for that, for one thing, you would have to round (or do you want partial minutes as decimal?) and the tags you are trying to extract are in text, so there’s no way to automagically do the math and convert.

> Question3--  Can the ffprobe handle multiple files e.g.  ‘NCIS*.wtv’

I don’t think you can input multiple files at once to ffprobe, I might be mistaken though. For ffmpeg, you need a “-i” in front of every input file, so globbing doesn’t work well.



More information about the ffmpeg-user mailing list