VideoReplace
✖
VideoReplace
uses the specified durfitting method to replace an interval of a different duration.
Details and Options


- VideoReplace can be used to replace a part of a video with a new video segment.
- The replacement content can be given as another video or image.
- The duration of the resulting video may change or stay the same. »
- The time t can be any of the following:
-
t time given in seconds Quantity[t,"Seconds"] time given in seconds or any compatible unit Quantity[t,"Frames"] time given as a number of frames - The durfitting method specifies how new replaces the {t1,t2} interval. Possible settings are:
-
"Fill" pad or trim new to duration t2-t1 (default) "Insert" remove video from t1 to t2 and insert new at t1 - Options to control frame replacement are:
-
ConformationMethod Automatic how to conform frames of different sizes - By default, VideoReplace places the new video under the "Video" directory in $WolframDocumentsDirectory.
- Options to control properties of the output video are:
-
AudioEncoding Automatic audio encoding to use CompressionLevel Automatic compression level to use GeneratedAssetFormat Automatic the file format of the result GeneratedAssetLocation $GeneratedAssetLocation location of the generated asset OverwriteTarget Automatic whether to overwrite an existing file SubtitleEncoding Automatic subtitle encoding to use VideoEncoding Automatic video encoding to use VideoTransparency False whether the output video should have a transparency channel

Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (11)Survey of the scope of standard use cases
Time Specifications (6)
Replace a single interval of a video:

https://wolfram.com/xid/09chnf6pe-154bvg

https://wolfram.com/xid/09chnf6pe-wto7bq
Show red, green and blue intensities over time:

https://wolfram.com/xid/09chnf6pe-8fs7ed

Replace a single interval and show intensities over time:

https://wolfram.com/xid/09chnf6pe-bwssrd

Replace multiple intervals with the same video:

https://wolfram.com/xid/09chnf6pe-j8i266

https://wolfram.com/xid/09chnf6pe-gupfut

Replace multiple intervals with different videos:

https://wolfram.com/xid/09chnf6pe-4it31j

https://wolfram.com/xid/09chnf6pe-ln7dx2

Specify intervals using time quantities:

https://wolfram.com/xid/09chnf6pe-08vchh

https://wolfram.com/xid/09chnf6pe-wjekfx

Specify intervals using a number of frames:

https://wolfram.com/xid/09chnf6pe-z0kk2l

https://wolfram.com/xid/09chnf6pe-k216rj
Show red, green and blue intensities of each frame:

https://wolfram.com/xid/09chnf6pe-clim4o

Specify times or intervals relative to the end of the video:

https://wolfram.com/xid/09chnf6pe-kdgcv7

https://wolfram.com/xid/09chnf6pe-8czdxm

Replace an interval starting 20 frames from the end:

https://wolfram.com/xid/09chnf6pe-nhkraf

Fitting (2)
By default, if the duration of replacement is longer than the specified interval, the video is trimmed:

https://wolfram.com/xid/09chnf6pe-oshvo7

https://wolfram.com/xid/09chnf6pe-v7gnb1

The duration of the result is approximately the same as the original video:

https://wolfram.com/xid/09chnf6pe-nkkcj

This is equivalent to the "Fill" fitting mode:

https://wolfram.com/xid/09chnf6pe-kg4mio

Use the "Insert" fitting mode to include all of the new video in the result:

https://wolfram.com/xid/09chnf6pe-k2k4d7

The duration of the result has increased by the difference in duration of the new video:

https://wolfram.com/xid/09chnf6pe-0tq4uk

If the new video is shorter than the specified interval, the "Insert" mode will only replace up to the duration of the new video:

https://wolfram.com/xid/09chnf6pe-du21ip

The duration of the result has decreased by the difference in duration of the new video:

https://wolfram.com/xid/09chnf6pe-ske1

By default, the new content is padded with black frames and silent audio if its duration is shorter than the specified replacement interval:

https://wolfram.com/xid/09chnf6pe-4r5mbj

https://wolfram.com/xid/09chnf6pe-3rt75o

This is equivalent to the "Fill" fitting mode:

https://wolfram.com/xid/09chnf6pe-xmxe9p

Use the "Insert" fitting mode to include all of the new video in the result:

https://wolfram.com/xid/09chnf6pe-sxmfhm

New Content (3)
Replace a segment of a video with a new video:

https://wolfram.com/xid/09chnf6pe-v6qfnj
Replace a single interval and show intensities over time:

https://wolfram.com/xid/09chnf6pe-k2q12t

Replace a segment of a video with an image:

https://wolfram.com/xid/09chnf6pe-cf6bb7
The image is repeated for the duration of the replacement interval:

https://wolfram.com/xid/09chnf6pe-d331t0

Replace a section of a video with constant color frames:

https://wolfram.com/xid/09chnf6pe-oae7ha

https://wolfram.com/xid/09chnf6pe-sebr2b

Options (1)Common values & functionality for each option
ConformationMethod (1)
The frame size is taken from the base video and new videos are conformed to that size:

https://wolfram.com/xid/09chnf6pe-lla64a
Replace the second half of a video segment with frames that have a different size and aspect ratio:

https://wolfram.com/xid/09chnf6pe-dif8ej
By default, frames from new videos are resized using the "Fit" method with black padding:

https://wolfram.com/xid/09chnf6pe-c3vwp5

Specify a different fitting method:

https://wolfram.com/xid/09chnf6pe-kcv90w

https://wolfram.com/xid/09chnf6pe-wkfvhu

Properties & Relations (2)Properties of the function, and connections to other functions
The properties of the original video, apart from duration, are not changed by default:

https://wolfram.com/xid/09chnf6pe-5j1s8v

https://wolfram.com/xid/09chnf6pe-hnokxj

Replace a section of the video with new content that has different properties:

https://wolfram.com/xid/09chnf6pe-o137wv

https://wolfram.com/xid/09chnf6pe-em101c

The default "Fill" method attempts to preserve the original duration:

https://wolfram.com/xid/09chnf6pe-c64w9o

The duration may change when the "Insert" method is used:

https://wolfram.com/xid/09chnf6pe-sx70vf
If the new video is longer than the replacement interval, the result will be longer than the original video:

https://wolfram.com/xid/09chnf6pe-08yzo6

The replacement intervals apply to all tracks in the video:

https://wolfram.com/xid/09chnf6pe-687lwr

Create a new video with one video and one audio track:

https://wolfram.com/xid/09chnf6pe-bf940v

Replace the content between 1 and 2 seconds:

https://wolfram.com/xid/09chnf6pe-d5mid8
Show the audio track of the resulting video:

https://wolfram.com/xid/09chnf6pe-k6rioa

If the new video contains tracks not present in the original video, those are not included in the result:

https://wolfram.com/xid/09chnf6pe-v8bmi

If the original video contains more tracks than the replacements, black frames and silence are inserted:

https://wolfram.com/xid/09chnf6pe-z1ilze
The original audio track is padded with silence for the specified interval:

https://wolfram.com/xid/09chnf6pe-6mj0xl

Wolfram Research (2021), VideoReplace, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoReplace.html (updated 2021).
Text
Wolfram Research (2021), VideoReplace, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoReplace.html (updated 2021).
Wolfram Research (2021), VideoReplace, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoReplace.html (updated 2021).
CMS
Wolfram Language. 2021. "VideoReplace." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/VideoReplace.html.
Wolfram Language. 2021. "VideoReplace." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/VideoReplace.html.
APA
Wolfram Language. (2021). VideoReplace. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoReplace.html
Wolfram Language. (2021). VideoReplace. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoReplace.html
BibTeX
@misc{reference.wolfram_2025_videoreplace, author="Wolfram Research", title="{VideoReplace}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/VideoReplace.html}", note=[Accessed: 22-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_videoreplace, organization={Wolfram Research}, title={VideoReplace}, year={2021}, url={https://reference.wolfram.com/language/ref/VideoReplace.html}, note=[Accessed: 22-May-2025
]}