VideoReplace
VideoReplace[video,{t1,t2}new]
replaces the video between t1 and t2 with the new video new.
VideoReplace[video,{{t11,t12},…}new]
replaces multiple intervals with the same video new.
VideoReplace[video,{{t11,t12}new1,…}]
replaces multiple intervals.
VideoReplace[video,…,durfitting]
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)
Scope (11)
Time Specifications (6)
Replace a single interval of a video:
Show red, green and blue intensities over time:
Replace a single interval and show intensities over time:
Replace multiple intervals with the same video:
Replace multiple intervals with different videos:
Specify intervals using time quantities:
Specify intervals using a number of frames:
Show red, green and blue intensities of each frame:
Specify times or intervals relative to the end of the video:
Fitting (2)
By default, if the duration of replacement is longer than the specified interval, the video is trimmed:
The duration of the result is approximately the same as the original video:
This is equivalent to the "Fill" fitting mode:
Use the "Insert" fitting mode to include all of the new video in the result:
The duration of the result has increased by the difference in duration of the new video:
If the new video is shorter than the specified interval, the "Insert" mode will only replace up to the duration of the new video:
The duration of the result has decreased by the difference in duration of the new video:
By default, the new content is padded with black frames and silent audio if its duration is shorter than the specified replacement interval:
This is equivalent to the "Fill" fitting mode:
Use the "Insert" fitting mode to include all of the new video in the result:
Options (1)
Properties & Relations (2)
The properties of the original video, apart from duration, are not changed by default:
Replace a section of the video with new content that has different properties:
The default "Fill" method attempts to preserve the original duration:
The duration may change when the "Insert" method is used:
If the new video is longer than the replacement interval, the result will be longer than the original video:
The replacement intervals apply to all tracks in the video:
Create a new video with one video and one audio track:
Replace the content between 1 and 2 seconds:
Show the audio track of the resulting video:
If the new video contains tracks not present in the original video, those are not included in the result:
If the original video contains more tracks than the replacements, black frames and silence are inserted:
The original audio track is padded with silence for the specified interval:
Text
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.
APA
Wolfram Language. (2021). VideoReplace. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoReplace.html