BrettSheleski / comchap

Commercial detection script to add chapters into video file
MIT License
138 stars 26 forks source link

ffmpeg needs all chapters to have a title statment and title #4

Closed Reed97123 closed 7 years ago

Reed97123 commented 7 years ago

If all the chapters don't have a title statement it mangles the chapters in the resulting file.

Example edl file:

0.00    8.88    0
83.78   243.74  0
781.15  1062.13 0
1514.78 1653.89 0
1843.04 1859.86 0

Original meta file from script (Note only commercials are labeled):

;FFMETADATA1
[CHAPTER]
TIMEBASE=1/1
START=0
END=0.00
[CHAPTER]
TIMEBASE=1/1
START=0.00
END=8.88
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=8.88
END=83.78
[CHAPTER]
TIMEBASE=1/1
START=83.78
END=243.74
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=243.74
END=781.15
[CHAPTER]
TIMEBASE=1/1
START=781.15
END=1062.13
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=1062.13
END=1514.78
[CHAPTER]
TIMEBASE=1/1
START=1514.78
END=1653.89
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=1653.89
END=1843.04
[CHAPTER]
TIMEBASE=1/1
START=1843.04
END=1859.86
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=1859.86

Resultant mangled chapters (from ffprobe):

    Chapter #0:0: start 0.000000, end 83.000000
    Metadata:
      title           : Commercial
    Chapter #0:1: start 83.000000, end 781.000000
    Metadata:
      title           : Commercial
    Chapter #0:2: start 781.000000, end 1514.000000
    Metadata:
      title           : Commercial
    Chapter #0:3: start 1514.000000, end 1843.000000
    Metadata:
      title           : Commercial
    Chapter #0:4: start 1843.000000, end 1859.000000
    Metadata:
      title           : Commercial
    Chapter #0:5: start 781.000000, end 1062.000000
    Metadata:
      title           : Commercial
    Chapter #0:6: start 1062.000000, end 1514.000000
    Metadata:
      title           :
    Chapter #0:7: start 1514.000000, end 1653.000000
    Metadata:
      title           : Commercial
    Chapter #0:8: start 1653.000000, end 1843.000000
    Metadata:
      title           :
    Chapter #0:9: start 1843.000000, end 1859.000000
    Metadata:
      title           : Commercial
    Chapter #0:10: start 1859.000000, end 1860.125000
    Metadata:
      title           :

Corrected metafile naming all chapters:

;FFMETADATA1
[CHAPTER]
TIMEBASE=1/1
START=0.00
END=8.88
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=8.88
END=83.78
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=83.78
END=243.74
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=243.74
END=781.15
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=781.15
END=1062.13
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=1062.13
END=1514.78
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=1514.78
END=1653.89
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=1653.89
END=1843.04
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=1843.04
END=1859.86
title=Commercial
[CHAPTER]
TIMEBASE=1/1
START=1859.86
title=Commercial

Resultant Correct mp4 (from ffprobe):

    Chapter #0:0: start 0.000000, end 8.000000
    Metadata:
      title           : Commercial
    Chapter #0:1: start 8.000000, end 83.000000
    Metadata:
      title           : Commercial
    Chapter #0:2: start 83.000000, end 243.000000
    Metadata:
      title           : Commercial
    Chapter #0:3: start 243.000000, end 781.000000
    Metadata:
      title           : Commercial
    Chapter #0:4: start 781.000000, end 1062.000000
    Metadata:
      title           : Commercial
    Chapter #0:5: start 1062.000000, end 1514.000000
    Metadata:
      title           : Commercial
    Chapter #0:6: start 1514.000000, end 1653.000000
    Metadata:
      title           : Commercial
    Chapter #0:7: start 1653.000000, end 1843.000000
    Metadata:
      title           : Commercial
    Chapter #0:8: start 1843.000000, end 1859.000000
    Metadata:
      title           : Commercial
    Chapter #0:9: start 1859.000000, end 1860.125000
    Metadata:
      title           :

The titles I inserted were all the same, but I actually think it might be better to name them something like:

The Roku lets me browse through the chapters and having them not named the same thing is a little more visually appealing.

BrettSheleski commented 7 years ago

Please test with latest and see if that resolves this issue.

Reed97123 commented 7 years ago

You're fast. I'll give this a good testing in the evening when I'm done with work.

Thanks!

Reed97123 commented 7 years ago

Tested with about 6 recorded programs. Everything looks fantastic. I didn't see a single issue.