tags:

views:

14

answers:

1

Hello there,

I'm aware later versions of ffmpeg seem to present this information in a more accessible form, but my application is running on an old version for many reasons right now.

Is it possible to extract

  • Format: flv (located after Input #0, )
  • Duration: 00:05:23.20 (located after Duration: )
  • Bitrate: N/A (located after bitrate: )
  • Video: h264, yuv420p, 640x360 [PAR 1:1 DAR 16:9] (located after Video: )
  • Audio: aac, 44100 Hz, mono, s16 (after Audio: )

In the knowledge that these figures/strings might change. It seems like a mammoth task in string searches to me, one I've often struggled with and eventually contemplated suicide. Is there a 'quick way'? or any widely applicable logic to getting this stuff.

... [flv @ 0xa3d3440]skipping flv packet: type 18, size 268, flags 0 Seems stream 0 codec frame rate differs from container frame rate: 50.00 (50/1) -> 25.00 (25/1) Input #0, flv, from '/var/www/vhosts/test/htdocs/5tester.flv': Duration: 00:05:23.20, start: 0.000000, bitrate: N/A Stream #0.0: Video: h264, yuv420p, 640x360 [PAR 1:1 DAR 16:9], 25 tbr, 1k tbn, 50 tbc Stream #0.1: Audio: aac, 44100 Hz, mono, s16 At least one o...

Thanks in advance for any help.

A: 

Use regular expressions and try to match your target strings... see preg_match_all

second way of achieving this is to use PHP's explode().

youssef azari
Could you give me an example for say, Bitrate?
WiseDonkey