Hello, not sure if ffmpeg returns codec information but it would be nice to know if codec supports backward playback.
Thank you,
Vytenis
Hello, not sure if ffmpeg returns codec information but it would be nice to know if codec supports backward playback.
Thank you,
Vytenis
Hey Vytenis,
In the mean time, you could also import a Python metadata library like Hachoir3 to retrieve all possible info about a media file:
hachoir3.readthedocs.io/metadata.html
(scroll down that page to see some example output)
or use mediaCLI see examples in this thread
Thanks,
I give it try. At the moment I’m using ffprobe with subprocess.
def readFFprobe(link ):
import subprocess
import json
name = var('TOUCH')
name = name.replace('/' , '\\')+'\\ffprobe.exe'
link = link.replace('/' , '\\')
cmd = [name , '-show_streams' ,'-print_format','json', '-loglevel','quiet', link]
ffprobe = subprocess.Popen(cmd, stdin=subprocess.PIPE,stdout=subprocess.PIPE ,stderr=subprocess.PIPE)
output , _ = ffprobe.communicate()
output = output.decode('utf-8')
j = json
a = j.loads(output)
return a['streams'][0]['codec_name'] , a['streams'][0]['r_frame_rate']