I have the following info being returned when I run tcprobe -i on a video file:
[tcprobe] RIFF data, AVI video
[avilib] V: 30.000 fps, codec=MJPG, frames=1599, width=640, height=480
[avilib] A: 8000 Hz, format=0x01, bits=8, channels=1, bitrate=64 kbps,
[avilib] 54 chunks, 427248 bytes, CBR
[tcprobe] summary for PICT1120.AVI, (*) = not default, 0 = not detected
import frame size: -g 640x480 [720x576] (*)
frame rate: -f 30.000 [25.000] frc=0 (*)
audio track: -a 0 [0] -e 8000,8,1 [48000,16,2] -n 0x1 [0x2000] (*)
bitrate=64 kbps
length: 1599 frames, frame_time=33 msec, duration=0:00:53.299
I would like to use regex to extract the frame rate (on line 2) please can anyone advise on how I can do this (just the no of frames, and not any of the surrounding text).
PS. Please bare in mind that the fps will vary as I will be using this script on various different video files.
Thanks
You could use an expression like:
With the FPS being in the first capturing group.
Perl example: