nicknsy / jellyscrub

Smooth mouse-over video scrubbing previews for Jellyfin.
MIT License
660 stars 25 forks source link

Not generating .bif files anymore #112

Closed wnhre2ur8cxx8 closed 1 year ago

wnhre2ur8cxx8 commented 1 year ago

The plugin has been working as usual, but I wanted to increase the number of images generated, so I set the "Image Interval" setting to 0 since it is very unclear what the value actually represents and it says in the notes that "A value of 0 defaults to a 1000ms interval." It used to be on 50000 since I thought it represents the ms.

After I changed it I started the job to generate the files again, but it didnt recreate the files anymore. So i figured if I delete the original files it will generate everything again from the start. I deleted every .bif file in /var/lib/jellyfin via a find command.

Since then it is still not generating the files anymore. The process is running as before and its seems like it is actually scanning and generating everything, but there are no files generated anymore.

Maybe I misunderstood how this thing works and it was stupid to delete everything. How can i fix this? And by the way, maybe clarify that the "interval" value represents ms or else what it represents :)

nicknsy commented 1 year ago

The interval is in ms. 0 defaults to 1000 since that is the lowest interval supported by BIF format, however I wouldn't go lower than 10000 (10s) because for something like a 2hr movie 7200 images is overkill.

I would change it to 10000 and restart the process. It's possible that using such a low interval could make it take longer to generate each BIF.

wnhre2ur8cxx8 commented 1 year ago

Ok, you should maybe think about changing "Interval of time between each new trickplay image." to "Interval of time in ms between each new trickplay image." to clear this.

But this was just a sidenote. I let it run for hours and hours and it reached something like 20%, by that there should have been a lot if files generated already. But there are none. I changed it to 10s now but I am not expecting the job to actually succeed because of that.

The logs also dont show anything specific, but there are a lot of errors. This was the case before aswell, so I cant really tell the difference. How can I find out what the specific ffmpeg commands are the plugin calls, so I can maybe get some more information?

nicknsy commented 1 year ago

What are the errors in the log?

wnhre2ur8cxx8 commented 1 year ago

like this

[2023-05-21 16:16:58.372 +02:00] [ERR] ffmpeg image extraction failed for /movie.mkv
[2023-05-21 16:16:58.376 +02:00] [ERR] Error while creating BIF file
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for /movie.mkv
   at Nick.Plugin.Jellyscrub.Drawing.OldMediaEncoder.ExtractVideoImagesOnInterval(String inputFile, String container, MediaStream videoStream, MediaSourceInfo mediaSource, Nullable`1 threedFormat, TimeSpan interval, String targetDirectory, String filenamePrefix, Int32 maxWidth, CancellationToken cancellationToken)
   at Nick.Plugin.Jellyscrub.Drawing.VideoProcessor.CreateBif(String path, Int32 width, Int32 interval, BaseItem item, MediaSourceInfo mediaSource, CancellationToken cancellationToken)
   at Nick.Plugin.Jellyscrub.Drawing.VideoProcessor.Run(BaseItem item, MediaSourceInfo mediaSource, Int32 width, Int32 interval, CancellationToken cancellationToken)

I changed logging to debug and now I can see the ffmpeg commands.

nicknsy commented 1 year ago

Whats the command? Do you have HW acceleration enabled?

nicknsy commented 1 year ago

Also relevant to #87

wnhre2ur8cxx8 commented 1 year ago

I have no Idea what changed. I am very sorry (for you the developer not me of course :stuck_out_tongue: ) but it just works again after several restarts. The only thing I did was comment out some strange tvshow entries in the "ContentTypes" section of system.xml that made no sense there. After a restart jellyfin even completely removed those entries. It seems very random and probably has nothing to do with another, but its the only thing that I changed except the log level.

Whats the command? Do you have HW acceleration enabled?

no hardware acceleration anymore, since that was too unstable in my setup. unfortunately I can only give you the command that was successful:

Creating trickplay files at 320 width, for /movie.mkv [ID: 9efe0f1a-201b-7e4f-f8aa-73c9901a7b78]
May 21 20:24:12 server jellyfin[81426]: [20:24:12] [INF] /usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -threads 0 -autorotate 0 -i file:"/movie.mkv" -an -sn -vf "fps=1/10,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,320)/2)*2:trunc(ow/a/2)*2,format=yuv420p" -threads 0 -c:v mjpeg -f image2 "/var/cache/jellyfin/temp/e9d928692af0474b94b8414c21efe77f/img_%08d.jpg"
May 21 20:24:12 server jellyfin[81426]: [20:24:12] [INF] Setting generation process priority to BelowNormal
May 21 20:31:48 server jellyfin[81426]: [20:31:48] [INF] Finished creation of trickplay file /var/lib/jellyfin/metadata/library/9e/9efe0f1a201b7e4ff8aa73c9901a7b78/trickplay/320.bif
nicknsy commented 1 year ago

Huh, weird. I'm glad it's working now but feel free to reopen the issue if anything changes.