Unmanic / unmanic-plugins

Official plugins for the Unmanic application
21 stars 71 forks source link

Pr ignore video file under size #366

Closed yajrendrag closed 11 months ago

yajrendrag commented 11 months ago

Added fix to allow video duration to be obtained from ffprobe format section if streams section is void of duration value.

BlakeGardner commented 11 months ago

This PR fixes the issue for me. Some video files were causing an exception to raise because ffprobe could not find the duration. Below I will provide the ffprobe command before and after this change and how it surfaces the duration on some video files.

Before change

ffprobe -v error -show_entries stream=duration,width,height -print_format json test_video.mkv
{
    "programs": [

    ],
    "streams": [
        {
            "width": 720,
            "height": 480,
            "side_data_list": [
                {

                }
            ]
        },
        {

        }
    ]
}

After change

ffprobe -v error -show_entries stream=duration,width,height:format=duration -print_format json test_video.mkv
{
    "programs": [

    ],
    "streams": [
        {
            "width": 720,
            "height": 480,
            "side_data_list": [
                {

                }
            ]
        },
        {

        }
    ],
    "format": {
        "duration": "633.472000"
    }
}