How do I reliably get get data not listed in show_format?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I reliably get get data not listed in show_format?

Nino from Read2Me
Hi, I'm interested in this bit:

Duration: 00:13:14.59, start: 0.006500, bitrate: 31 kb/s

    Stream #0:0: Audio: opus, 48000 Hz, mono, fltp

According to a few trac tickets (for example
<https://trac.ffmpeg.org/ticket/2226>) this bit is not meant to be parsed,
so how do you recommend I get duration as human readable, bitrate and
sampling? I don't see those listed in [FORMAT][/FORMAT].

I've tried this on both ffprobe 3.4.1 (darwin) and 2.8.14 (ubuntu).


BTW I wanted to chime in on a trac discussion but couldn't complete the
registration, see attached.

--
Kind regards,

Nino Škopac
- CEO of Škopac LLC <https://crobiznet.com/supplier/skopac/about-us> (VAT
ID: HR18537663219)
- Founder of Read2Me <https://read2me.online/>, a SaaS featured on
ProductHunt <https://www.producthunt.com/posts/read2me> and BetaList
<https://betalist.com/startups/read2me>
- Software engineering contractor
<https://www.upwork.com/freelancers/~013469808662f577d0>

Skype: nino.skopac
Mobile: +44 20 3290 5302

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

Screen Shot 2018-05-11 at 22.29.13.png (906K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How do I reliably get get data not listed in show_format?

Lou Logan
On Fri, May 11, 2018, at 7:36 AM, Nino from Read2Me wrote:

> Hi, I'm interested in this bit:
>
> Duration: 00:13:14.59, start: 0.006500, bitrate: 31 kb/s
>
>     Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
>
> According to a few trac tickets (for example
> <https://trac.ffmpeg.org/ticket/2226>) this bit is not meant to be parsed,
> so how do you recommend I get duration as human readable, bitrate and
> sampling? I don't see those listed in [FORMAT][/FORMAT].

For duration examples:
https://trac.ffmpeg.org/wiki/FFprobeTips#Duration

For sample rate:
ffprobe -loglevel error -select_streams a -show_entries stream=sample_rate -of csv=p=0 input.mkv

You can of course combine entries:

-show_entries format=format_name:stream=codec_type,channels

> BTW I wanted to chime in on a trac discussion but couldn't complete the
> registration, see attached.

Sorry about that. Should be fixed now.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How do I reliably get get data not listed in show_format?

Carl Zwanzig
In reply to this post by Nino from Read2Me
On 5/11/2018 8:36 AM, Nino from Read2Me wrote:
> Duration: 00:13:14.59, start: 0.006500, bitrate: 31 kb/s
>
>      Stream #0:0: Audio: opus, 48000 Hz, mono, fltp
>
> According to a few trac tickets (for example
> <https://trac.ffmpeg.org/ticket/2226>) this bit is not meant to be parsed,

Um, when someone _reads_ the text, they're parsing it.

Maybe it's not intended to be _machine_ parsed, but I've had no trouble with
breaking down the text with some code.  It sounds like the better argument
is why the informational (not error) output intended for a human to see is
being sent to stderr. IMHO, the answer in the ticket is specious.

OTOH, with a simple workaround, it probably isn't worth the time to submit a
patch.

Later,

z!

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: How do I reliably get get data not listed in show_format?

Lou Logan
On Sun, May 13, 2018, at 8:12 AM, Carl Zwanzig wrote:
>
> Um, when someone _reads_ the text, they're parsing it.

The ticket seems obvious to me that it is referring to machine parsing.

> Maybe it's not intended to be _machine_ parsed, but I've had no trouble with
> breaking down the text with some code.  It sounds like the better argument
> is why the informational (not error) output intended for a human to see is
> being sent to stderr. IMHO, the answer in the ticket is specious.

The comments in the ticket are valid, and you should not be machine parsing the stderr output to get input information. The output is not guaranteed to be accurate (for example it shows a shorthand "29.97 fps" instead of 30000/1001).  Processing it requires additional tools or code, and the resulting processed output may be easily broken with a variety of assorted inputs.

Use ffprobe instead: it is a proper tool for the job.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".