ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

How do I read back errors?

Open roman-ku opened this issue 6 years ago • 8 comments

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.

roman-ku avatar Jan 18 '19 05:01 roman-ku