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

request feature #12

Closed
frezeen opened this issue Aug 16, 2020 · 7 comments
Closed

request feature #12

frezeen opened this issue Aug 16, 2020 · 7 comments

Comments

@frezeen
Copy link

frezeen commented Aug 16, 2020

im here for to write my 2 cents about this one.
compiled from repo on a rpi4 for docker jellyfin version 10.6.2 confirm plugin work without problems.
tested with about 10+ videos downloaded with yuoutubedl.
all good, no problems.

i have a request only, can the plugin autocatch the video ID from .json files created from youtubedl?
its a pain to manually add the id in downloaded files name everytime

thanks for all

@ankenyr
Copy link
Owner

ankenyr commented Aug 17, 2020 via email

@frezeen
Copy link
Author

frezeen commented Aug 17, 2020

if i dont raname with [ID numer].mp4 , plugin dont add metadata.
image is not added to library, is it becouse Jason dont have image info maybe?
question is: can i avoid to rename downloaded files with ID in name file everytime?
i think best logic is: ask Jason for ID, rename file with [ID], query youtube for updated metadata + image
or more best is ask Jason for ID and query youtube without need rename file.
rename file broken youtubedl-material db for example.

@ankenyr
Copy link
Owner

ankenyr commented Aug 17, 2020

If your mp4 file and .json file have the same name without the extensions, it should get the metadata from the json file.

@frezeen
Copy link
Author

frezeen commented Aug 17, 2020

i dont know whats the problem is but it dont work for me

[2020-08-18 01:36:02.530 +02:00] [INF] [36] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshStart "20d817cb6cb1ce4d601f6f1f88e48405"
[2020-08-18 01:36:02.599 +02:00] [INF] [36] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4
[2020-08-18 01:36:02.685 +02:00] [INF] [27] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider:
[2020-08-18 01:36:02.685 +02:00] [INF] [27] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: Youtube ID not found in filename of title: Lewis Capaldi - Someone You Loved
[2020-08-18 01:36:02.687 +02:00] [INF] [27] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalProvider: Could not find "/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
[2020-08-18 01:36:02.756 +02:00] [ERR] [25] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
[2020-08-18 01:36:02.759 +02:00] [ERR] [25] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: I-frame image extraction failed, will attempt standard way. Input: "file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4""
System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken)
[2020-08-18 01:36:02.842 +02:00] [ERR] [27] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
[2020-08-18 01:36:02.846 +02:00] [ERR] [27] MediaBrowser.Providers.Movies.MovieMetadataService: Error in "Screen Grabber"
System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken)
at MediaBrowser.Providers.MediaInfo.VideoImageProvider.GetVideoImage(Video item, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ItemImageProvider.RefreshFromProvider(BaseItem item, IDynamicImageProvider provider, ImageRefreshOptions refreshOptions, TypeOptions savedOptions, LibraryOptions libraryOptions, ICollection`1 downloadedImages, RefreshResult result, CancellationToken cancellationToken)
[2020-08-18 01:36:02.930 +02:00] [INF] [27] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshComplete "20d817cb6cb1ce4d601f6f1f88e48405"

file names are how youtubedl-material use:
Lewis Capaldi - Someone You Loved.mp4
Lewis Capaldi - Someone You Loved.info.json

try rename Lewis Capaldi - Someone You Loved.info.json in Lewis Capaldi - Someone You Loved with no success same log

@ankenyr
Copy link
Owner

ankenyr commented Aug 18, 2020 via email

@frezeen
Copy link
Author

frezeen commented Aug 18, 2020

Excuse me if I insist
that error is becouse my ffmpeg in jellyfin cant manage av1 format , i dont know if is that the problem but, listen me please, and sorry again for this
if i rename files:
Lewis Capaldi - Someone You Loved.mp4
Lewis Capaldi - Someone You Loved
THIS DONT WORK
here the log:
[12:28:01] [INF] [103] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4
Unsupported codec with id 32797 for input stream 0
[12:28:01] [INF] [42] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider:
[12:28:01] [INF] [42] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: Youtube ID not found in filename of title: Lewis Capaldi - Someone You Loved
[12:28:01] [INF] [42] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalProvider: Could not find /data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4
[12:28:01] [ERR] [98] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
[12:28:01] [ERR] [98] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: I-frame image extraction failed, will attempt standard way. Input: file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken)
[12:28:01] [ERR] [98] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
[12:28:01] [ERR] [98] MediaBrowser.Providers.Movies.MovieMetadataService: Error in Screen Grabber
System.Exception: ffmpeg image extraction failed for file:"/data/video/Youtube/Lewis Capaldi - Someone You Loved.mp4"
at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable1 imageStreamIndex, Nullable1 threedFormat, Nullable1 offset, Boolean useIFrame, CancellationToken cancellationToken) at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String[] inputFiles, String container, MediaStream videoStream, Nullable1 imageStreamIndex, MediaProtocol protocol, Boolean isAudio, Nullable1 threedFormat, Nullable1 offset, CancellationToken cancellationToken)
at MediaBrowser.Providers.MediaInfo.VideoImageProvider.GetVideoImage(Video item, CancellationToken cancellationToken)
at MediaBrowser.Providers.Manager.ItemImageProvider.RefreshFromProvider(BaseItem item, IDynamicImageProvider provider, ImageRefreshOptions refreshOptions, TypeOptions savedOptions, LibraryOptions libraryOptions, ICollection`1 downloadedImages, RefreshResult result, CancellationToken cancellationToken)

but if i delete jason and rename file:
Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4

the log:
[12:33:07] [INF] [33] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4
[12:33:07] [INF] [33] MediaBrowser.Providers.Manager.ProviderManager: OnRefreshComplete 20d817cb6cb1ce4d601f6f1f88e48405
[12:33:07] [INF] [33] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4
[12:33:15] [INF] [59] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4
Unsupported codec with id 32797 for input stream 0
[12:33:15] [INF] [66] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: Jtauh8GcxBY
[12:33:15] [INF] [66] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: [null]
[12:33:15] [INF] [66] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeMetadataProvider: Google.Apis.YouTube.v3.Data.Video
[12:33:15] [INF] [66] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalProvider: Could not find /data/video/Youtube/Lewis Capaldi - Someone You Loved [Jtauh8GcxBY].mp4

and this one finally work. metadata + image is grabbed from Youtube
dont know if this can help u, but i dont think image grabber error mean somethings. u know, u are the hero :)

edit: i have new info.
if i use plugin with a supported video file i got this log:
[13:31:26] [INF] [71] Jellyfin.Plugin.YoutubeMetadata.Providers.YoutubeLocalImageProvider: /data/video/Youtube/Marco Mengoni - Ti ho voluto bene veramente (Videoclip).mp4

metadata are OK but file image is not the youtube official, i think its a frame grabbed from video

if i understand something, your plugin, if found jason , grab a image from video file and metaddata from jason, if file video is unsupported got a lots errors and dont work while, if jason is missing and u put ID on file name, grab metadata and good image from youtube without problems.

can we use this logic:
if jason present pick id and grab all from youtube and let this image from video grab process for who dont want to use the api key?
i think u use grab image from video for discard use of api key.

@ankenyr
Copy link
Owner

ankenyr commented Aug 18, 2020

The image being extracted is due to an image not being found for the youtube plugin. The providers (things that grab metadata) are setup as either local or remote providers. Local being grabbing information from files local to the server (NFO, JSON , etc) or remote in that they use an API.

Providers also, I believe, run in a loop where all applicable providers are run, with their level of priority, until all metadata is filled or it gets to the end.

In this case the local metadata provider is being run and it gets to the youtube plugin. It will look for the JSON file. Inside the json file it contains metadata pertaining to the video. It will also look for a file with the same name but ending in jpg and use that for the image.

Having the local metadata provider end up doing remote actions would break convention.

There are a couple of ways forward here.

  1. wait for Add support for fields in Identify for Youtube. #6 and you can tell jellyfin to use a specific ID for a file to ID it. This will help for one offs but if your entire library is not working this won't scale
  2. Fix your library by including the ID. For your downloaded files this could be done with a script and for future videos you can refer to the output template documentation from youtube-dl https://github.com/ytdl-org/youtube-dl#output-template

@ankenyr ankenyr closed this as completed Aug 18, 2020
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

2 participants