Open ghost opened 3 years ago
And why does this lib even exists if I can do:
ffprobe -print_format json -show_streams -show_format -loglevel quiet -hide_banner
It looks like the issue is a regex problem. My exception was raised on this line
' Chapter #0:0: start 0.000000, end 485.902000\n'
In particular, on the string
end 485.902000\n
The regex being used to piece this apart
m = re.search(r'(\w+)\s*:\s*(.*)$', s)
Wont return anything as the string above doesn't match the regex listed. I am not quite sure the best way to go about parsing that out, though to @venomone 's point, this entire script could be redone to simply wrap and ingest the output of -print_format json -show_format
Also probably worth using that -hide_banner
flag to ignore parsing out (and ignoring) the banner text displayed by ffprobe.
Both these options appear to be quite old in ffprobe, so they should be safe to use here. https://github.com/FFmpeg/FFmpeg/blame/master/fftools/ffprobe.c If I have more time I might look into doing that. For now though I am going to have to abandon this project and inject the output json myself
If anyone's looking for a longer-term solution, I've implemented the above
ffprobe -print_format json -show_streams -show_format
command-line, plus a bunch of other bug-fixes, features, and improvements, in a fork:
https://github.com/jboy/ffprobe3-python3
(Python3 only, sorry.)
Hey folks,
this lib seems exactly what im looking for but Im unable to properly parse all information using the following snipped:
I always get back the following error:
can smb help ?