# Wolfram video processing is too slow for real-life situations

**URL:** <https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895>\
**Category:** Questions\
**Tags:** tuning-and-debugging, video-processing\
**Created:** [August 17, 2025, 6:15pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895 "2025-08-17T18:15:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![trinhquangdao](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@trinhquangdao](https://community.wolfram.com/u/trinhquangdao)\
**Post date:** [August 17, 2025, 6:15pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/1 "2025-08-17T18:15:27Z")

</div>

Wolfram Video Processing is too slow in real-life situations. I love using Wolfram Language for real-life applications, and I appreciate that Wolfram has recently focused on first-class video functionality. However, it’s a pity that while it works fine for demonstrations, it is far too slow for practical use.

For example, when I use CapCut to edit and render a 5-minute video, it takes only a few seconds. But in Wolfram Mathematica, the same process is extremely slow. For a simple 7-minute video (with only text overlay), Wolfram takes 6 minutes just to render. That is unusable! Imagine processing a **30-minute video—it could take 45 minutes** , while CapCut would finish in under a minute.

 ![1755454340--0Codec.nb_-Wolfram.jpg](https://global.discourse-cdn.com/wolfram/original/2X/c/c4987300bfa68fc9392fc3943288cb3f3659d191.jpeg)

I have also tried adjusting encoders, frame rates, and other settings, but it didn’t help.  
Can someone suggest a solution? Thank you very much.

---

<div class="post-metadata">

**Author:** ![carlogico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/carlogico/32/21067_2.png) [@carlogico](https://community.wolfram.com/u/carlogico)\
**Post date:** [August 19, 2025, 3:12pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/2 "2025-08-19T15:12:25Z")

</div>

The operation in WL will be necessarily slower, since the operation is performed in a kernel evaluation, and the second argument can be an arbitrary expression. We are working on making this faster for the next version. In the meantime, here are some tricks to achieve a speedup in this particular operation:

```
In[13]:= OverlayVideo[v, "Text"]; // AbsoluteTiming

Out[13]= {10.8377, Null}

In[24]:= t = Rasterize["Text", Background -> None];
OverlayVideo[v, 
   Rasterize["Text", Background -> None]]; // AbsoluteTiming

Out[25]= {8.15988, Null}

In[26]:= 
Parallelize[
   VideoFrameMap[ImageCompose[#, "Text"] &, 
    Video["ExampleData/bullfinch.mkv"]]]; // AbsoluteTiming

Out[26]= {2.0267, Null}

In[27]:= 
Parallelize[
   VideoFrameMap[ImageCompose[#, t] &, 
    Video["ExampleData/bullfinch.mkv"]]]; // AbsoluteTiming

Out[27]= {1.78399, Null}

```

I’m using a 15 second video of the same dimensions.

---

<div class="post-metadata">

**Author:** ![carlogico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/carlogico/32/21067_2.png) [@carlogico](https://community.wolfram.com/u/carlogico)\
**Post date:** [August 19, 2025, 3:32pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/3 "2025-08-19T15:32:21Z")

</div>

If the goal is only to overlay some text, consider adding subtitles:

```
In[34]:= VideoCombine[{v, "Text"}]; // AbsoluteTiming

Out[34]= {1.52954, Null}

```

or use the “drawtext” ([FFmpeg Filters Documentation](https://ffmpeg.org/ffmpeg-filters.html#drawtext)) ffmpeg filter:

```
In[30]:= 
VideoFrameMap[{{"drawtext", "fontsize" -> "56", 
     "text" -> "Hello World"}}, v]; // AbsoluteTiming

Out[30]= {3.3095, Null}

```

---

<div class="post-metadata">

**Author:** ![trinhquangdao](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@trinhquangdao](https://community.wolfram.com/u/trinhquangdao)\
**Post date:** [August 28, 2025, 9:28am UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/4 "2025-08-28T09:28:42Z")

</div>

Thank you [@Carlo Giacometti](https://community.wolfram.com/web/carlogico) , I would like to use Wolfram to edit a longer video, not only add text (subtitle), but also editting the video. The function VideoCombine is the “soft subtitle”, it’s fast. But I need the “hardcode subtitle”, so I need to render the video with the text.

Can you help me answer these questions, so that I would like to improve the rendering speed in Wolfram.

1. As far as I know, Wolfram is using ffmpeg to edit, and render the video. So in general, the rendering speed should be similar, compared to using Python and ffmpeg command? Is it correct?

 ![1756372193--0Codec.nb_-Wolfram.jpg](https://global.discourse-cdn.com/wolfram/original/2X/5/5cd618520f59d0ae7aa3ce2ffc7494e1ccda2103.jpeg)

1. My computer has the NVIDIA GPU, so in general, when I use the NVIDIA Codec, it could be very fast. When I try to use the NVENC Coding, with EncodingSpeed, the render speed is still slow, nothing has improved. Why? How can we use the NVIDIA Codec in Wolfram? I have tested several codecs in Wolfram, and none of these codecs get the similar speed like using Capcut.

 ![1756372540--0Codec.nb_-Wolfram.jpg](https://global.discourse-cdn.com/wolfram/original/3X/9/6/96f107fcd74b8acc1e114ff5401d22a9fafc636c.jpeg)

 ![1756372257--0Codec.nb_-Wolfram.jpg](https://global.discourse-cdn.com/wolfram/original/3X/6/c/6cb29de6f1d72d73554a150edfffbb8588732603.jpeg)

1. I have found that several posts also confirm that the configuration in Wolfram, or ffmpeg is very slow (rendering speed). For example this post: [Why is ffmpeg so slow to create a video compared to CapCut, for example?](https://superuser.com/questions/1790679/why-is-ffmpeg-so-slow-to-create-a-video-compared-to-capcut-for-example) If I would like to render the video in Wolfram, by using this option\*\*: -c:v h264\_videotoolbox -b:v 6000K,\*\* how to do that? Or how to apply the preset very fast, to encode in Wolfram: Like this command: **ffmpeg -i input.mp4 -c:v h264\_nvenc -preset fast -cq 23 -c:a aac -b:a 128k output.mp4**

 ![1756373016--Whyisffmpegsoslowtocreateavi.jpg](https://global.discourse-cdn.com/wolfram/original/3X/0/3/03aaa895e50f6b24f2ef451dd1b6cb1b76fbb180.jpeg)

---

<div class="post-metadata">

**Author:** ![russell](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/russell/32/19742_2.png) [@russell](https://community.wolfram.com/u/russell)\
**Post date:** [August 28, 2025, 4:55pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/5 "2025-08-28T16:55:36Z")

</div>

So to make sure I understand correctly: you can make Mathematica use FFMPEG for video encoding, but it is still slow because it is presumably using its default settings which are slow, and you have also figured out how to make FFMPEG go faster using its command line configuration options, but are asking if there is a way to set these configuration options when calling it from within the Wolfram Language?

---

<div class="post-metadata">

**Author:** ![trinhquangdao](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@trinhquangdao](https://community.wolfram.com/u/trinhquangdao)\
**Post date:** [August 31, 2025, 11:29pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/6 "2025-08-31T23:29:24Z")

</div>

I read the Wolfram documentation, it seems that Wolfram is using ffmpeg.  
But I wonder why is it too slow? compared to another solution (using another software to render the video).  
I need the confirmation of the Wolfram Developper.

---

<div class="post-metadata">

**Author:** ![carlogico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/carlogico/32/21067_2.png) [@carlogico](https://community.wolfram.com/u/carlogico)\
**Post date:** [September 2, 2025, 2:37pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/7 "2025-09-02T14:37:14Z")

</div>

Mathematica is indeed using ffmpeg to write images to a video file. Using the Nvidia based encoders should be quite fats, but there are three parts to this operation:

1. frames are read from the input file and loaded in the kernel (decoding)

2. the kernel performs the desired operation (rendering)

3. the resulting frame is written to the output video file (encoding)

Only operations 1) and 3) are performed by ffmpeg.

---

<div class="post-metadata">

**Author:** ![trinhquangdao](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@trinhquangdao](https://community.wolfram.com/u/trinhquangdao)\
**Post date:** [September 6, 2025, 12:48pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/8 "2025-09-06T12:48:35Z")

</div>

Hello,  
I want to add the logo, and the SRT (Subtitle text) to the video.  
Well, for the 14 minutes video, in Wolfram, it says that I need 9h to render the video.  
It is unacceptable !

 ![1757162627--1VideoHardcodeSRT.nb_OP_Running..._CP_.jpg](https://global.discourse-cdn.com/wolfram/original/3X/f/b/fb911388567820cd7d3e539bdcf1a1b08b905eec.jpeg)

I have the latest GEFORCE NVIDIA GPU.  
In Capcut, it takes only 1 minutes to do that.  
So I hope that you can help me. I have a lot of videos, that’s why I need to do this programmatically.  
Best regards,

---

<div class="post-metadata">

**Author:** ![carlogico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/carlogico/32/21067_2.png) [@carlogico](https://community.wolfram.com/u/carlogico)\
**Post date:** [September 6, 2025, 1:00pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/9 "2025-09-06T13:00:15Z")

</div>

What does VAddCaption call? have you tried any of the suggested solutions?

---

<div class="post-metadata">

**Author:** ![carlogico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/carlogico/32/21067_2.png) [@carlogico](https://community.wolfram.com/u/carlogico)\
**Post date:** [September 6, 2025, 1:16pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/10 "2025-09-06T13:16:29Z")

</div>

To rasterize subtitles into the video, try

```
VideoFrameMap[{{"subtitles", "filename" -> "1.srt"}}, Video ["1.mp4"]]

```

---

<div class="post-metadata">

**Author:** ![trinhquangdao](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@trinhquangdao](https://community.wolfram.com/u/trinhquangdao)\
**Post date:** [September 6, 2025, 7:52pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/11 "2025-09-06T19:52:27Z")

</div>

Thank you [@Carlo Giacometti](https://community.wolfram.com/web/carlogico) .

1. I think I have found a bug with **VideoFrameMap[{{“drawtext”, “text” → “test”}}, Video[“test.mp4”]]** I hear the sound “Ding”, but no error is shown. And then the memory state of the all the symbol in the notebook is cleared. I have tested 3-4 times, and the same happened.

2. VAddCaption is a function based on your propositions: The text is converted to Rasterize: textImg=Rasterize[“Text”, Background → None]; and Then the textImg is added to Video by **OverlayVideo[Video[“test.mp4”],textImg]** However, this approach is super slow. For 15 minutes videos, it renders frame by frame, and it will takes 9h to finish.

3. The fastest approach is: **VideoFrameMap[{{“subtitles”, “filename” → “test.srt”}}, Video[“test.mp4”]]** However, this approach is not explained in the Wolfram Documentation. I can’t found it. I think that, this approach is using the directly ffmpeg command. That’s why it is so much faster. But I can’t change the position, or the text color. I have the default white text.

4. So my question: I would like to change the logo (image), and I also want to change the text color, and modify the text position, using the VideoFrameMap[{{"subtitles}}] approach, how to do that? Thank you very much.

---

<div class="post-metadata">

**Author:** ![trinhquangdao](https://avatars.discourse-cdn.com/v4/letter/t/977dab/32.png) [@trinhquangdao](https://community.wolfram.com/u/trinhquangdao)\
**Post date:** [September 6, 2025, 10:37pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/12 "2025-09-06T22:37:19Z")

</div>

Here is the update.  
It seems that Wolfram is using the command from ffmpeg.  
For example, the subtitle:  
I managed to get the speed = 26x.

 ![1757198114--0Codec.nb_-Wolfram.jpg](https://global.discourse-cdn.com/wolfram/original/3X/6/1/61e713afc287ad9728f402769724d71e63ef960d.jpeg)

When I run the ffmpeg, I get the 64x. Wow ! So much faster, with the same result !

 ![1757198199--WindowsPowerShell.jpg](https://global.discourse-cdn.com/wolfram/original/2X/1/1106d378751a16b52554d85423160e7a6ceeaa15.jpeg)

So in a long run, I need to switch more to the direct approach of using ffmpeg.

---

<div class="post-metadata">

**Author:** ![carlogico](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/carlogico/32/21067_2.png) [@carlogico](https://community.wolfram.com/u/carlogico)\
**Post date:** [September 7, 2025, 5:42pm UTC](https://community.wolfram.com/t/wolfram-video-processing-is-too-slow-for-real-life-situations/25895/13 "2025-09-07T17:42:10Z")

</div>

To change styling, you can either use the force\_style argument in the subtitles filter (documented here: [FFmpeg Filters Documentation](https://ffmpeg.org/ffmpeg-filters.html#subtitles-1)), eg:

```
VideoFrameMap[{{"subtitles", 
   "filename" -> FindFile["ExampleData/bullfinch.mkv"], 
   "force_style" -> "PrimaryColour=&HCCFF0000"}}, 
 Video["ExampleData/bullfinch.mkv"]]

```

Or you can create a new subtitle track based on the existing one using WL functionality. You can specify SubtitleStyle to control the appearance of all subtitles. If you want to specify each subtitle on ints own you can use the Text and Style wrappers to control appearance and positioning of each subtitle.

```
v = Video["ExampleData/bullfinch.mkv"];
newVid = 
  VideoCombine[{v, VideoExtractTracks[v, {"Subtitle", 1}]}, 
   SubtitleStyle -> {Italic, Orange, Bold, Larger, 
     FontFamily -> "Big Caslon", Background -> LightGreen}];
VideoFrameMap[{{"subtitles", 
   "filename" -> Information[newVid, "ResourcePath"][[1]]}}, newVid]

```
