meeb / tubesync

Syncs YouTube channels and playlists to a locally hosted media server
GNU Affero General Public License v3.0
1.87k stars 119 forks source link

Embed Metadata / Thumbnail does not seem to be working #412

Open theverex opened 12 months ago

theverex commented 12 months ago

Hello there,

Any videos I use TubeSync to download that have the 'Embed Metadata' or the 'Embed Thumbnail' checkboxes checked don't seem to embed the metadata at all in the MKV File.

Once the file is downloaded, I check and there is no Title, Subtitle or any other metadata from the video embedded.

When using the NFO / JSON options, they create with the expected metadata (however there is no metadata in the actual MKV file). If I am not mistaken when the embed options are selected they should be embedded in the MKV file?

I am after this so I can then extract the audio track (for things like podcasts) to take on the road rather than a video file. it would also be great if there was the possibility to choose for the video tracks not to be downloaded and just the audio tracks?

*EDIT: Just updated to 13.0 to test and this still applies.

meeb commented 12 months ago

All TubeSync does is effectively do the API equivalent of passing --embed-metadata to yt-dlp, it doesn't make any active decisions or attempt to embed any metadata itself. Historically there was some issues with writing metadata to MKV containers with older versions of ffmpeg but that's been resolved for a while. If there's metadata you want that's missing it's going to most likely be an yt-dlp issue, unless there's some additional metadata API flags I've missed off. See:

https://github.com/meeb/tubesync/blob/main/tubesync/tubesync/settings.py#L162

Note the metadata in the NFO file is manually written by TubeSync.

As for audio only, that feature has been available since the first release. Just add a source and select "Audio only" from the "Source resolution" drop-down.

theverex commented 12 months ago

Thanks for the quick reply! Noted about the audio only, I did forget you can do that. It would be helpful to be able to add the same source though so you could download a video file, then a separate audio only as well. I can't add another channel key because it flags as a duplicate to set up an audio only download.

It's strange on the metadata, I've been doing some additional testing using yt-dlp as well and that does write the metadata as expected when using the --embed-metadata (it will write the title and comments).

yt-dlp command: yt-dlp --embed-metadata https://www.youtube.com/watch?v=IUN664s7N-c

I can add the channel to TubeSync with the 'embed metadata' option selected but when I view the metadata the title and comments are not there.

meeb commented 12 months ago

Make sure you test with outputting the video in an MKV container as well, the default containers for MP4 or WEBM usually have different metadata support.

theverex commented 12 months ago

Yep it does output in MKV (using yt-dlp), in the command prompt you get a warning and it will auto select MKV container:

WARNING: webm doesn't support embedding a thumbnail, mkv will be used

The MKV container works fine for the basic metadata when using yt-dlp, but does not when using TubeSync.

meeb commented 12 months ago

Interesting, then I would guess either I'm missing something on the API call or the --embed-metadata is doing something different to 'addmetadata': True. I'll take a look later, I've not read any of the yt-dlp API code for quite some time.