# Script to regenerate video previews multi threaded?

**URL:** <https://forums.plex.tv/t/script-to-regenerate-video-previews-multi-threaded/788360>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [April 15, 2022, 5:40am UTC](https://forums.plex.tv/t/script-to-regenerate-video-previews-multi-threaded/788360 "2022-04-15T05:40:26Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Volts](https://avatars.discourse-cdn.com/v4/letter/v/a5b964/32.png) [@Volts](https://forums.plex.tv/u/Volts)\
**Post date:** [April 18, 2022, 10:46pm UTC](https://forums.plex.tv/t/script-to-regenerate-video-previews-multi-threaded/788360/9 "2022-04-18T22:46:40Z")

</div>

That’s significantly faster than I expected! Neat. I might guess that keyframe extraction just doesn’t parallelize well across multiple threads.

I wonder if there’s any way to speed up the jpeg encoding, too! I suspect that’s actually a majority of the CPU time now. At first glance I don’t think that’s accelerated in `ffmpeg` today.

* * *

As an alternative to assembling the .bif files and inserting them where Plex expects, you could instead create a wrapper around the `Plex Transcoder` process, altering only the JPG extraction step.

Here are some examples that do similar things:

[GitHub - ForsakenNGS/raspi-plex-transcode: Help for manipulating the plex-media-server transcode on the raspberry pi](https://github.com/ForsakenNGS/raspi-plex-transcode)

[Feature request: use ffmpeg's `-ac` flag for downmixing - #15 by imax](https://forums.plex.tv/t/feature-request-use-ffmpegs-ac-flag-for-downmixing/659199/15)

---

_[View the full topic](https://forums.plex.tv/t/script-to-regenerate-video-previews-multi-threaded/788360)._
