I am writing a program to get the output of the video length played (time in seconds) in mplayer. Usually the output of mplayer is
Playing video.mp4.
Detected file format: QuickTime / MOV (libavformat)
[lavf] stream 0: video (h264), -vid 0
Clip info:
major_brand: dash
minor_version: 0
compatible_brands: iso6avc1mp41
creation_time: 2017-11-03 00:36:26
Load subtitles in .
Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [libavcodec]
Starting playback...
VIDEO: 1920x1080 23.976 fps 1343.8 kbps (168.0 kB/s)
VO: [x11] 1920x1080 => 1920x1080 Planar YV12
[swscaler @ 0xb5cea980]No accelerated colorspace conversion found from yuv420p to bgra.
[swscaler @ 0xb5cea980]using unscaled yuv420p -> bgra special converter
Colorspace details not fully supported by selected vo.
V: 78.0 0/ 0 8% 117% 0.0% 0 0
I want the time output of the last line.
i.e.78.0
I am saving the logs in a file using this command:
mplayer video.mp4 2>timing.log | grep V:
Which will be read by the python function running in parallel to the Thread function playing the same video.
Is there any way where I can store only the timings.
As I am unable to get the timings from the log file, as it returns me null.