Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tdarr_Plugin_a9hf_New_file_duration_check - Stream duration issue #727

Open
Renegade605 opened this issue Dec 5, 2024 · 0 comments
Open

Comments

@Renegade605
Copy link

The duration reported in ffProbeData and mediaInfo is the duration of the longest stream in the container. However, some streams may be longer than the video stream (subtitles, specifically, don't ask me why) so the duration of the file is set longer than the video. If these longer streams are removed, the new duration will be "correct" as now matching the video stream, but causes the job to fail as the file duration shows as having decreased by half. Suggest switching this check to the duration of the video stream.

  ...
  "file_size": 1916.238193511963,
  "ffProbeData": {
    "streams": [
      {
        "index": 0,
        "codec_name": "h264",
        "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
        "profile": "High",
        "codec_type": "video",
        ...
        "tags": {
          "BPS": "9059769",
          "DURATION": "00:27:36.125000000",                                                  **************
          ...
        }
      },
      ...
      {
        "index": 16,
        "codec_name": "subrip",
        "codec_long_name": "SubRip subtitle",
        "codec_type": "subtitle",
        ...
        "duration": "3208.165000",                                                             *****************************
        ...
        "tags": {
          ...
          "DURATION": "00:53:27.276000000",                                               **********************
          "NUMBER_OF_FRAMES": "912",
          "NUMBER_OF_BYTES": "33047",
          ...
        }
      },
      ...
    ],
    "format": {
      ...
      "duration": "3208.165000",                                        *****************************
      ...
      }
    }
  },
  "meta": {...},
  "mediaInfo": {
    "@ref": "",
    "track": [
      ...
      {
        "@type": "Video",
        "StreamOrder": "0",
        "ID": "1",
        "UniqueID": "8373942118020032245",
        "Format": "AVC",
        "Format_Profile": "High",
        "Format_Level": "4",
        "Format_Settings_CABAC": "Yes",
        "Format_Settings_RefFrames": "4",
        "CodecID": "V_MPEG4/ISO/AVC",
        "Duration": "1656.125000000",                                            *******************
        ...
      },
      ...
      {
        "@type": "Text",
        "@typeorder": "15",
        "StreamOrder": "16",
        "ID": "17",
        "UniqueID": "11098659598244129571",
        "Format": "UTF-8",
        "CodecID": "S_TEXT/UTF8",
        "Duration": "3207.276000000",                                                ******************
        "BitRate": "82",
        "FrameRate": "0.284",
        "FrameCount": "912",
        "ElementCount": "912",
        "StreamSize": "33047",
        "Title": "Portuguese (Brazil)",
        "Language": "pt-BR",
        "Default": "No",
        "Forced": "No"
      },
      ...
      ]
  "duration": 3208                                                                   ***********************************
}```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant