mifi / lossless-cut

The swiss army knife of lossless video/audio editing
https://losslesscut.app/
GNU General Public License v2.0
25.89k stars 1.25k forks source link

Export YouTube Chapter Time Indexes #657

Closed Schlaegel closed 3 years ago

Schlaegel commented 3 years ago

(First, I've got to say thanks. This software is great.)

A very easy, and very useful change would allow LossLessCut to export chapter indexes as supported by YouTube.

See: https://support.google.com/youtube/answer/9884579?hl=en https://www.youtube.com/watch?v=b1Fo_M_tj6w

This could be an additional option in the "Export Project" menu.

The file format is similar to "Timestamps (TSV/TXT)". However, YouTube doesn't support the decimal and doesn't use an end time. It does optionally support the hour, but usually the videos don't use hours since most YouTube videos are shorter than an hour.

Here is one of my own videos in the existing "Timestamps (TSV/TXT)" format...

00:00:00.000 00:07:04.576 1st Flight 00:07:04.576 00:12:42.145 2nd Flight 00:12:42.145 00:17:41.471 3rd Flight 00:17:41.471 00:23:28.540 4th Flight 00:23:28.540 00:27:31.365 5th Flight 00:27:31.365 00:29:33.189 6th Flight 00:29:33.189 00:33:49.012 7th Flight

Here is what that same video in YouTube Chapter format could look like...

00:00 ​1st Flight 07:04​ 2nd Flight 12:42​ 3rd Flight 17:41​ 4th Flight 23:28​ 5th Flight 27:31​ 6th Flight 29:33​ 7th Flight

However, since YouTube doesn't support anything more accurate than a second, I recommend going to the next second when exporting this format, so the ideal result for that same video would be...

00:00 1st Flight 07:05​ 2nd Flight 12:43 3rd Flight 17:42 4th Flight 23:29 5th Flight 27:32 6th Flight 29:34 7th Flight

Of course, if you wanted to always include the hour, it would look like...

00:00:00 1st Flight 00:07:05​ 2nd Flight 00:12:43 3rd Flight 00:17:42 4th Flight 00:23:29 5th Flight 00:27:32 6th Flight 00:29:34 7th Flight

markusd1984 commented 3 years ago

This is brilliant, however, I think using the exported timestamps with chapter markers is only useful for unedited videos where you upload that source file,

otherwise, when one intends to upload an exported merged video that was edited in LC, it would need to be an export option that uses the actual timestamps that were used for the exact cuts in the export, which may differ from the project.

mifi commented 3 years ago

I thought about something like this, but it may be a bit confusing because like you say only start time will be exported. If they have gaps between segments it may seem a bit unnatural. What's the actual use case of this? Why is it useful?

markusd1984 commented 3 years ago

What gaps? Ability to export segment start times to create YouTube chapters is better than none, especially including label titles, even if they are off by 1-2 secs. :blush:

mifi commented 3 years ago

If the user has a timeline like this, how should it export it as youtube?

Screenshot 2021-02-16 at 23 06 23

Ok, so I understand you just want a convenience function to be able to open any video and easily create youtube chapters without exporting a video? so that you can then uplaod the video to youtube and the paste the chapters in the video description?

markusd1984 commented 3 years ago

While this could also be used for new videos which won't be edited in LC, chapters for hese could also easily be done in YT itself.

It's more a convenience feature for videos already cut in LC via segments as half the work is already done, since just the correct timestamp format is required post export. Hence I think it's a great enhancement suggested by Schlaegel, that i would use and would think others too (if they realise the benefits) since chapters for video playback are so useful and cool.

Could be called "Export YouTube chapters" with some help text explaining that segment cut times and titles will be used for chapter in the YouTube timeline.

mifi commented 3 years ago

but the segment timestamps are not the same as the resulting times after cutting.

What the user could do however is as follows:

  1. create the desired cut segments
  2. export with "Create chapters from merged segments" enabled
  3. Open the exported file
  4. See dialog "This file has embedded chapters. Do you want to import the chapters as cut-segments?" and press Import chapters
  5. File -> Export project -> YouTube chapters (this feature request)
markusd1984 commented 3 years ago

@mifi that's exactly why I said it has to be created during export, completely forgot about the existing include chapter feature, that's indeed what is required just in a slight different output for YT chapters and without step 3-5 as it could be created during step 2 :smile:

Providing a File export YT option when a merged video is loaded that includes chapters from the export could be a nice to have feature in case one forgot to do it and thus no need for re-exporting, but not essential.

Schlaegel commented 3 years ago

My workflow is to use LC to go through 5 separate videos, trimming each to be just the part of the video that I want. Then, I merge the 5 trimmed files with LC, preserving the chapters. When I open the merged file in LC, it has the five segments marked, and no dead space, and I then export the times. I hand-massage the exported time data to a YouTube usable format. I upload the merged file to YouTube, and add the hand-massaged times to the description.

For simplicity, I think the YouTube timestamps should be based on the current video, since those are already listed in the UI that would be expected. Having hidden magic that removes the skipped segments could be useful as an option, but isn't necessary, nor obvious.

Of course if the timestamps were created as part of the export and merge process, it would be obvious, but that seems like a new UI.

(Really, I also take the merged file and do some audio extracting with LC, mixing with other software, and then replacing the original audio with the mixed audio using LC. None of this affects the time stamps though... As you can see I'm grateful for LC.)

markusd1984 commented 3 years ago

I think it's worthwhile having both, during export and as an Export Project option as this could potentially attract more Youtubers using LC :)

Or for now just the export profile to have it as an option for now and if demand/issues rise we can make it available for export,

either as an additional advanced option i.e. underneath chapters (but takes up more space) or better perhaps make the chapter profile switchable (like merge & separate button) between "Video Chapters | YouTube Chapters | Video & YouTube Chapters" (or instead of Video Chapters call it Timeline Chapters)

and in the "?" tool tip description add more explanations, for both that the fact of creating Video Chapters "allows for loading the merged video files including chapters" as I bet many won't realise this benefit and the fact that YouTube chapters is beneficial for YouTube uploads for an enhanced timeline playback experience (as some people also are not aware of this). 😄

mifi commented 3 years ago
Screenshot 2021-02-19 at 13 41 01
mifi commented 3 years ago

Implemented! Note that I've not implemented the cut+chapters+youtube-chapters as that is a bit complex, only current segments.

markusd1984 commented 3 years ago

That's as a menu or export profile option, displayed on-screen? Nice.

Perhaps accurate chapter markers is only important for videos with longer key frames spanning over more than one second, where the impact of inaccurate cuts in the export could cause chapter points oosisbly to be off by 1-3 seconds, right?

Without an post export YT formatted chapter index one has to then remember to first export the merged video incl. chapters and load the exported merged file with chapters (which are the accurate cut points) to then get the more accurate YT chapter (cuts).

Although not sure why you think adding one more chapter timestamp export in a separate file would be more complex? (Not sure why you're referring to "cut" re "cut+chapters+youtube-chapters" unless you mixed that up with the merging option, which was meant only as an exampe, I was referring to the current "yes/no" option. image

Update: I thought the chapters were saved in the project.csv file but I guess that's not the case then, being saved in the actual merged video file itself - hence perhaps why it's slower to export and I take that's why it requires more complex coding to extract the cut points to save into a separate file.

mifi commented 3 years ago

yes chapters are inside the file (MP4/MKV at least). it's not more complex for the user, but it's more complex to implement and I'm not sure how many people would use that. It could be nice to have an option like you say to export final cut times as a separate file, but I'm not sure if it's something that's often needed. And it can probably be achieved quite easily with other tools when you have a file with chapters in it.