Ffprobe - get file information from a channel

I have an oog file (it was mixed with sox from two audio streams recorded by Asterisk pbx) and I'm trying to get file information using ffprobe. When I use something like

cat %filename%.ogg | ffprobe -i - 

I get invalid file information (Duration: N / A, wrong bitrate, etc.). When i try

 ffprobe -i %filename% 

Everything works fine, and I get file information. What could be wrong? File contents?

+4
source share
2 answers

Starting with version 1.0.7 ffprobe you can even get output in formatted JSON:

ffprobe -v quiet -print_format json -show_format Ramp \ - \ Apathy.mp3

Which produces the output:

 { "format": { "filename": "Ramp - Apathy.mp3", "nb_streams": 2, "format_name": "mp3", "format_long_name": "MP2/3 (MPEG audio layer 2/3)", "start_time": "0.000000", "duration": "203.638856", "size": "4072777", "bit_rate": "159999", "tags": { "title": "Apathy", "artist": "Ramp", "album": "Evolution Devolution Revolution", "date": "1999", "genre": "Metal" } } } 

I think you can get the probe with cat, do you have any requirements for the contents of the file? If not just use ffprobe without cat.

+5
source

Just a quick note to say that the input to connect to ffprobe seems to work fine. Use a hyphen instead of the input file, and you go to the race. Here is an example with a random video file on my system:

 cat 01.mp4 | ffprobe -show_format -pretty -loglevel quiet - 

Returns:

 [FORMAT] filename=pipe: nb_streams=2 nb_programs=0 format_name=mov,mp4,m4a,3gp,3g2,mj2 format_long_name=QuickTime / MOV start_time=N/A duration=0:02:56.400000 size=N/A bit_rate=N/A probe_score=100 TAG:major_brand=isom TAG:minor_version=512 TAG:compatible_brands=isomiso2mp41 TAG:creation_time=1970-01-01T00:00:00.000000Z TAG:title=yy.mp4 TAG:encoder=Lavf52.78.3 [/FORMAT] 
+1
source

All Articles