ffmpeg-python
ffmpeg-python copied to clipboard
How do I read back errors?
When I get this back from ffmpeg ffprobe error (see stderr output for detail) I do not know how to check the stderr output for the details.
import sys
import ffmpeg
from ffmpeg import Error as FFmpegError
try:
duration = ffmpeg.probe('https://www.youtube.com/watch?v=cv4123_39ddfa324LB23MsYg')['format']['duration']
except FFmpegError as e:
print(e)
# doesn't work
# for line in sys.stderr:
# print(line)
# doesn't work
# data = sys.stderr.readlines()
# print(data)
Couldn't find an example of this in the documentation and couldn't figure it out myself.