faissaloo / SponSkrub

Strip advertisements from downloaded YouTube videos
GNU General Public License v3.0
177 stars 7 forks source link

start_sample < end_sample when setting all categories #16

Closed faissaloo closed 3 years ago

faissaloo commented 3 years ago

Cut using: ydl -dl-args '-f 18' -skrub-args '-include-intros -include-outros -include-interactions -include-selfpromo -include-nonmusic' 'https://www.youtube.com/watch?v=_2khAmMTAjI' FFMPEG reports: Assertion start_sample < end_sample || (start_sample == end_sample && !frame->nb_samples) failed at src/libavfilter/trim.c:303 This is something's probably up with the cutting code, I'm guessing it doesn't like having two sections that need to be removed right next to each other but I need to actually check the cutting data, quick way to do this might be to look at the data used for generating chapters.

Generated chapter data:

;FFMETADATA1
[CHAPTER]
TIMEBASE=1/1
START=0
END=4.945143
title=sponskrub-sponsor

[CHAPTER]
TIMEBASE=1/1
START=4.945143
END=10.923932
title=sponskrub-selfpromo

[CHAPTER]
TIMEBASE=1/1
START=10.923932
END=13.813807
title=sponskrub-intro

[CHAPTER]
TIMEBASE=1/1
START=13.813807
END=1211.093116
title=sponskrub-content

[CHAPTER]
TIMEBASE=1/1
START=1211.093116
END=1215.540042
title=sponskrub-sponsor

[CHAPTER]
TIMEBASE=1/1
START=1215.540042
END=1215.540042
title=sponskrub-selfpromo

[CHAPTER]
TIMEBASE=1/1
START=1215.540042
END=1262.079000
title=sponskrub-selfpromo

[CHAPTER]
TIMEBASE=1/1
START=1262.079000
END=1262.079000
title=sponskrub-outro

[CHAPTER]
TIMEBASE=1/1
START=1262.079000
END=1263.024000
title=sponskrub-outro

[CHAPTER]
TIMEBASE=1/1
START=1263.024000
END=1263.024000
title=sponskrub-interaction

[CHAPTER]
TIMEBASE=1/1
START=1263.024000
END=1273.721000
title=sponskrub-interaction

[CHAPTER]
TIMEBASE=1/1
START=1273.721000
END=1283.135000
title=sponskrub-content

Sponsorblock data from https://api.sponsor.ajay.app/api/skipSegments?videoID=_2khAmMTAjI&categories=[%22sponsor%22,%22intro%22,%22outro%22,%22interaction%22,%22selfpromo%22,%20%22music_offtopic%22]:

[
  {
    "category": "sponsor",
    "segment": [
      0,
      4.98681
    ],
    "UUID": "61231d8b11a5a6a617baf75e01380ade0d45968c6d23ae64835fc034c7a3dd3b"
  },
  {
    "category": "sponsor",
    "segment": [
      1211.093116,
      1265.507428
    ],
    "UUID": "356a29d6a350b9350fc928fe0eb6417a5537534c18c957a5bffed6cba214ee90"
  },
  {
    "category": "intro",
    "segment": [
      10.923932,
      13.813807
    ],
    "UUID": "94de1ba8643e4dfb9d3d1dd620361e708056b49776897ae7e44eb652c7b99369"
  },
  {
    "category": "outro",
    "segment": [
      1273,
      1283.101
    ],
    "UUID": "e44f720fc45a118af13d1ab477a184cea3c4a1eeff2fa833806205338c73b02e"
  },
  {
    "category": "interaction",
    "segment": [
      1263.024,
      1273.721
    ],
    "UUID": "1641a66bd936318a228cf022e15948c76af530c6a544e89ad49b1291e565b781"
  },
  {
    "category": "selfpromo",
    "segment": [
      4.945143,
      10.965599
    ],
    "UUID": "462f61ed1595aa51951b935b16761bf4eb1a0230e2a35b3b0abcf9c16d39b333"
  },
  {
    "category": "selfpromo",
    "segment": [
      1215.540042,
      1263.024103
    ],
    "UUID": "6d668403bc51efd1a1f6fe2ced55d4cefe997269599fe8eb8023fb50fcdb1c10"
  }
]

This would be a good in for writing some tests for the chaptering code.

faissaloo commented 3 years ago

Other videos with the same issue: https://www.youtube.com/watch\?v\=92t8np88fEI