CrypticSignal / bitrate-plotter

Plots a graph showing the bitrate every second or the bitrate of every GOP, for an audio or video file.
23 stars 2 forks source link

Minor fix for current ffprobe #2

Open clort81 opened 3 months ago

clort81 commented 3 months ago

in ffprobe_out_parser.py i had to change the parser for ffprobe output.

    for line in io.TextIOWrapper(process.stdout, encoding="utf-8"):
        ## ffprobe will return the time in ms and the size in bytes.
        if line.strip():  # Check if the line is not empty                                                                                                                       
            dts_time, packet_size = line.strip().split(",", 2)[:2]   # grab only 2 fields
             # original bad code dts_time, packet_size = line.strip().split(",")

It was choking on empty lines and for some reason ffprobe was returning lines with a trailing comma. This gets past that problem.

Thanks for the real hepful tool!

CrypticSignal commented 3 months ago

Feel free to open a pull request and you can be listed as a contributor of this tool :)