Jellyfin Forum
Trickplay, again - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+---- Forum: Media Scanning & Identification (https://forum.jellyfin.org/f-media-scanning-identification)
+---- Thread: Trickplay, again (/t-trickplay-again)

Pages: 1 2


Trickplay, again - fract - 2024-07-05

Code:
[2024-07-05 00:04:56.648 +00:00] [INF] [172] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay process unresponsive.
[2024-07-05 00:04:56.648 +00:00] [INF] [172] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Stopping trickplay extraction.
[2024-07-05 00:04:57.649 +00:00] [INF] [172] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Killing ffmpeg process

this happens regulary on UHD files.
what is strange, for regular HD content trickplay generation works fine....? for example, HD or SD behindthescenes files for UHD movie that fails in same folder will be processed fine.
this was introduced at some point after upgrading to 10.9.x...
Initial trickplay conversion (through jellyscrub plugin) finished fine, but after upgrade, and for new UHD content, trickplay generation fails.

i am running Docker Jelly on Synology 920+, latest 10.9.7 atm, with hw acceleration.
worked flawlessly until now...

I do see a lot of question on forum regarding trickplay generation, any ideas with my UHD problem...?

example below:

Code:
[2024-07-05 00:30:40.391 +00:00] [INF] [46] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Creating trickplay files at 320 width, for "/usbshare2/Plex/UHD/Movies/Mortal Kombat (2021)/Mortal Kombat (2021).mkv" [ID: 1d20e878-b104-92b7-1fc9-d5559cea075d]
[2024-07-05 00:30:40.391 +00:00] [INF] [46] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: "/usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va -filter_hw_device qs -hwaccel qsv -hwaccel_output_format qsv -c:v hevc_qsv -noautorotate -i file:\"/usbshare2/Plex/UHD/Movies/Mortal Kombat (2021)/Mortal Kombat (2021).mkv\" -noautoscale -an -sn -vf \"fps=0.10000000149011612,setparams=color_primaries=bt2020:color_trc=smpte2084:colorspace=bt2020nc,scale_qsv=w=320:h=132,hwmap=derive_device=vaapi,format=vaapi,procamp_vaapi=b=0:c=1.2,tonemap_vaapi=format=nv12:p=bt709:t=bt709:m=bt709:extra_hw_frames=32,hwmap=derive_device=qsv,format=qsv\" -threads 1 -c:v mjpeg_qsv -qscale:v 4 -f image2 \"/cache/temp/28237d64931e4a5589012da6cbc7226c/%08d.jpg\""
[2024-07-05 00:30:40.473 +00:00] [ERR] [154] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Error creating trickplay images.
System.ArgumentException: Can't create trickplay from 0 images.
  at Jellyfin.Server.Implementations.Trickplay.TrickplayManager.CreateTiles(List`1 images, Int32 width, TrickplayOptions options, String outputDir)
  at Jellyfin.Server.Implementations.Trickplay.TrickplayManager.RefreshTrickplayDataInternal(Video video, Boolean replace, Int32 width, TrickplayOptions options, CancellationToken cancellationToken)
[2024-07-05 00:30:40.497 +00:00] [INF] [154] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Creating trickplay files at 320 width, for "/usbshare2/Plex/UHD/Movies/Lawrence of Arabia (1962)/Lawrence of Arabia (1962).mkv" [ID: ae5f0585-7f5b-fb88-7fae-a8eb56b84d97]
[2024-07-05 00:30:40.498 +00:00] [INF] [154] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: "/usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va -filter_hw_device qs -hwaccel qsv -hwaccel_output_format qsv -c:v hevc_qsv -noautorotate -i file:\"/usbshare2/Plex/UHD/Movies/Lawrence of Arabia (1962)/Lawrence of Arabia (1962).mkv\" -noautoscale -an -sn -vf \"fps=0.10000000149011612,setparams=color_primaries=bt2020:color_trc=smpte2084:colorspace=bt2020nc,scale_qsv=w=320:h=146,hwmap=derive_device=vaapi,format=vaapi,procamp_vaapi=b=0:c=1.2,tonemap_vaapi=format=nv12:p=bt709:t=bt709:m=bt709:extra_hw_frames=32,hwmap=derive_device=qsv,format=qsv\" -threads 1 -c:v mjpeg_qsv -qscale:v 4 -f image2 \"/cache/temp/3796c64a1c7548688291dbde2652cf41/%08d.jpg\""
[2024-07-05 00:30:40.580 +00:00] [ERR] [46] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Error creating trickplay images.
System.ArgumentException: Can't create trickplay from 0 images.

Code:
[2024-07-05 00:27:56.296 +00:00] [INF] [46] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Creating trickplay files at 320 width, for "/usbshare2/Plex/UHD/Movies/Mortal Kombat (2021)/From Game to Screen - The Making of Mortal Kombat-behindthescenes.mkv" [ID: c2795ab1-1495-3b20-eedd-4496365a5b3d]
[2024-07-05 00:27:56.296 +00:00] [INF] [46] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: "/usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel qsv -hwaccel_output_format qsv -c:v hevc_qsv -noautorotate -i file:\"/usbshare2/Plex/UHD/Movies/Mortal Kombat (2021)/From Game to Screen - The Making of Mortal Kombat-behindthescenes.mkv\" -noautoscale -an -sn -vf \"fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_qsv=w=320:h=132:format=nv12\" -threads 1 -c:v mjpeg_qsv -qscale:v 4 -f image2 \"/cache/temp/5655b666b829423099b4a3330307da73/%08d.jpg\""
[2024-07-05 00:28:42.025 +00:00] [INF] [154] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Finished creation of trickplay files for "/usbshare2/Plex/UHD/Movies/Mortal Kombat (2021)/From Game to Screen - The Making of Mortal Kombat-behindthescenes.mkv"
[2024-07-05 00:28:42.054 +00:00] [INF] [154] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Creating trickplay files at 320 width, for "/usbshare2/Plex/UHD/Movies/Mortal Kombat (2021)/Fight Koreography-behindthescenes.mkv" [ID: df294339-22a7-a196-c82f-c7544f46d2c2]
[2024-07-05 00:28:42.054 +00:00] [INF] [154] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: "/usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -init_hw_device vaapi=va:,kernel_driver=i915,driver=iHD -init_hw_device qsv=qs@va -filter_hw_device qs -hwaccel qsv -hwaccel_output_format qsv -c:v hevc_qsv -noautorotate -i file:\"/usbshare2/Plex/UHD/Movies/Mortal Kombat (2021)/Fight Koreography-behindthescenes.mkv\" -noautoscale -an -sn -vf \"fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_qsv=w=320:h=132:format=nv12\" -threads 1 -c:v mjpeg_qsv -qscale:v 4 -f image2 \"/cache/temp/95b327f4050243b3a9d9b416ad90f342/%08d.jpg\""
[2024-07-05 00:29:00.708 +00:00] [INF] [161] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Finished creation of trickplay files for "/usbshare2/Plex/UHD/Movies/Mortal Kombat (2021)/Fight Koreography-behindthescenes.mkv"



RE: Trickplay, again - TheDreadPirate - 2024-07-05

IIRC, Intel deprecated OpenCL support for Linux kernel 4.4.X. Which is the Linux kernel that a lot of Synology NASes are still using. Since it tone mapping, which uses OpenCL, when it is HWA decoding that is likely the source of the failure.

Quote:-init_hw_device opencl=ocl@va ..... procamp_vaapi=b=0:c=1.2,tonemap_vaapi=format=nv12:p=bt709:t=bt709:m=bt709:extra_hw_frames=32

The only solution is to turn off hardware accelerated decoding for trickplays, but you can leave HWA trickplay encoding enabled.


RE: Trickplay, again - fract - 2024-07-07

Nope, tried it....with or without HW accel, still timeouts, trickply process unresponsive.
i also tested on second server (this one is windows, also 10.9.7) without any GPU, raw cpu only, same thing...for some reason,, trickplay will not be generated for UHD files.
really confused with this.


RE: Trickplay, again - TheDreadPirate - 2024-07-07

In the log it should show the full ffmpeg command. What happens when you run the exact same command on the command line? Does it show you more information about why it is failing?


RE: Trickplay, again - fract - 2024-07-07

here's log excerpt:

Code:
[2024-07-07 03:01:48.931 +02:00] [INF] [121] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Creating trickplay files at 320 width, for "Z:\PLEX\UHD\Movies\Bullet Train (2022)\Bullet Train (2022).mkv" [ID: 70aced25-9ea2-b06b-d488-a48576b7b15c]
[2024-07-07 03:01:48.935 +02:00] [INF] [121] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: "ffmpeg -loglevel error -threads 1 -noautorotate -i file:\"Z:\PLEX\UHD\Movies\Bullet Train (2022)\Bullet Train (2022).mkv\" -an -sn -vf \"fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p\" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 \"C:\jellydata\cache\temp\c2c25e16ac87435dad919ffead1b6dfe\%08d.jpg\""
[2024-07-07 03:04:49.064 +02:00] [INF] [153] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay process unresponsive.
[2024-07-07 03:04:49.066 +02:00] [INF] [153] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Stopping trickplay extraction.
[2024-07-07 03:04:50.075 +02:00] [INF] [153] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Killing ffmpeg process
[2024-07-07 03:04:50.078 +02:00] [ERR] [153] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for "ffmpeg -loglevel error -threads 1 -noautorotate -i file:\"Z:\PLEX\UHD\Movies\Bullet Train (2022)\Bullet Train (2022).mkv\" -an -sn -vf \"fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p\" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 \"C:\jellydata\cache\temp\c2c25e16ac87435dad919ffead1b6dfe\%08d.jpg\""
[2024-07-07 03:04:50.081 +02:00] [ERR] [153] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Error creating trickplay images.
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for ffmpeg -loglevel error -threads 1 -noautorotate -i file:"Z:\PLEX\UHD\Movies\Bullet Train (2022)\Bullet Train (2022).mkv" -an -sn -vf "fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 "C:\jellydata\cache\temp\c2c25e16ac87435dad919ffead1b6dfe\%08d.jpg"
  at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractVideoImagesOnIntervalInternal(String inputArg, String filterParam, String vidEncoder, Nullable`1 outputThreads, Nullable`1 qualityScale, Nullable`1 priority, CancellationToken cancellationToken)
  at Jellyfin.Server.Implementations.Trickplay.TrickplayManager.RefreshTrickplayDataInternal(Video video, Boolean replace, Int32 width, TrickplayOptions options, CancellationToken cancellationToken)
[2024-07-07 03:04:50.392 +02:00] [INF] [153] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Creating trickplay files at 320 width, for "Z:\PLEX\UHD\Movies\Children of the Corn (1984)\Children of the Corn (1984).mkv" [ID: f9918a68-f778-3c92-9a4f-04b283f5c281]
[2024-07-07 03:04:50.396 +02:00] [INF] [153] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: "ffmpeg -loglevel error -threads 1 -noautorotate -i file:\"Z:\PLEX\UHD\Movies\Children of the Corn (1984)\Children of the Corn (1984).mkv\" -an -sn -vf \"fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p\" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 \"C:\jellydata\cache\temp\3c44ddf2fcd84e3a82f9f369c3076477\%08d.jpg\""
[2024-07-07 03:50:31.687 +02:00] [INF] [111] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay process unresponsive.
[2024-07-07 03:50:31.690 +02:00] [INF] [111] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Stopping trickplay extraction.
[2024-07-07 03:50:32.700 +02:00] [INF] [111] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Killing ffmpeg process
[2024-07-07 03:50:32.702 +02:00] [ERR] [111] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for "ffmpeg -loglevel error -threads 1 -noautorotate -i file:\"Z:\PLEX\UHD\Movies\Children of the Corn (1984)\Children of the Corn (1984).mkv\" -an -sn -vf \"fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p\" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 \"C:\jellydata\cache\temp\3c44ddf2fcd84e3a82f9f369c3076477\%08d.jpg\""
[2024-07-07 03:50:32.705 +02:00] [ERR] [111] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Error creating trickplay images.
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for ffmpeg -loglevel error -threads 1 -noautorotate -i file:"Z:\PLEX\UHD\Movies\Children of the Corn (1984)\Children of the Corn (1984).mkv" -an -sn -vf "fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 "C:\jellydata\cache\temp\3c44ddf2fcd84e3a82f9f369c3076477\%08d.jpg"
  at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractVideoImagesOnIntervalInternal(String inputArg, String filterParam, String vidEncoder, Nullable`1 outputThreads, Nullable`1 qualityScale, Nullable`1 priority, CancellationToken cancellationToken)
  at Jellyfin.Server.Implementations.Trickplay.TrickplayManager.RefreshTrickplayDataInternal(Video video, Boolean replace, Int32 width, TrickplayOptions options, CancellationToken cancellationToken)
[2024-07-07 03:50:33.061 +02:00] [INF] [111] Jellyfin.Server.Implementations.Trickplay.TrickplayManager: Creating trickplay files at 320 width, for "Z:\PLEX\UHD\Movies\Causeway (2022)\Causeway (2022).mkv" [ID: f19687ef-fcc7-3f6d-50c7-b24aba4bb047]
[2024-07-07 03:50:33.067 +02:00] [INF] [111] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay generation: "ffmpeg -loglevel error -threads 1 -noautorotate -i file:\"Z:\PLEX\UHD\Movies\Causeway (2022)\Causeway (2022).mkv\" -an -sn -vf \"fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p\" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 \"C:\jellydata\cache\temp\2e277387105f4bf192a3128734e17354\%08d.jpg\""
[2024-07-07 03:52:33.152 +02:00] [INF] [150] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Trickplay process unresponsive.
[2024-07-07 03:52:33.155 +02:00] [INF] [150] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Stopping trickplay extraction.
[2024-07-07 03:52:34.163 +02:00] [INF] [150] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Killing ffmpeg process



RE: Trickplay, again - TheDreadPirate - 2024-07-08

Ok. Open a command prompt and run this.

Code:
ffmpeg -loglevel error -threads 1 -noautorotate -i file:"Z:\PLEX\UHD\Movies\Bullet Train (2022)\Bullet Train (2022).mkv" -an -sn -vf "fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 test.jpg



RE: Trickplay, again - fract - 2024-07-08

heres output...this is for windows machine...i dont know if same command can be run for Synology?

Code:
C:\ffmpeg-7.0.1-full_build\bin>ffmpeg -loglevel error -threads 1 -noautorotate -i file:"Z:\PLEX\UHD\Movies\Bullet Train (2022)\Bullet Train (2022).mkv" -an -sn -vf "fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 test.jpg
[image2 @ 000001b96b7f9580] Cannot write more than one file with the same name. Are you missing the -update option or a sequence pattern?
[vost#0:0/mjpeg @ 000001b96bd403c0] Error submitting a packet to the muxer: Invalid argument
    Last message repeated 1 times
[out#0/image2 @ 000001b96b7cd000] Error muxing a packet
[out#0/image2 @ 000001b96b7cd000] Task finished with error code: -22 (Invalid argument)
[out#0/image2 @ 000001b96b7cd000] Terminating thread with return code -22 (Invalid argument)

synology otput, different movie:

Code:
ffmpeg -loglevel error -threads 1 -noautorotate -i file:"/volumeUSB2/usbshare/Plex/UHD/Movies/Mortal Kombat (2021)/Mortal Kombat (2021).mkv" -an -sn -vf "fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 test.jpg
[NULL @ 0x562257523a00] Requested output format 'image2' is not a suitable output format
test.jpg: Invalid argument



RE: Trickplay, again - TheDreadPirate - 2024-07-08

Hold up. Are you running on Windows or Docker? You've shared logs from both.

If your actual Jellyfin server is running in Docker, you'd need to open a bash shell for the container and run this.

Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -loglevel error -threads 1 -noautorotate -i "/path/to/video.mkv" -an -sn -vf "fps=0.10000000149011612,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*(a*sar))\,320)/2)*2:trunc(ow/(a*sar)/2)*2,format=yuv420p" -threads 1 -c:v mjpeg -qscale:v 4 -f image2 test.jpg

Jellyfin-ffmpeg has some customizations that vanilla ffmpeg doesn't have. Not sure if that makes a difference in how it will behave.


RE: Trickplay, again - fract - 2024-07-08

like i said, i am running both,
one syno docker, other windows machine... separate macines, both running latest 10.9.7
same issue in both cases, trickplays for UHD not being generated.
regardles of command and ffmpeg version i try, same result,  in both cases.
thus, two examples, like you noticed.


RE: Trickplay, again - TheDreadPirate - 2024-07-08

Is it the same hardware each OS is running on? For the synology output, was that from within the container or just on the OS? If it was done on the OS's command line, open a bash shell for the container and use jellyfin-ffmpeg with the same options. jellyfin-ffmpeg incorporates a lot of changes not present in vanilla ffmpeg.