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

Examples

open allclose all

Basic Examples  (1)

Replace the first second of a video with black frames:

Show frames at every second:

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:

Replace an interval starting 20 frames from the end:

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:

New Content  (3)

Replace a segment of a video with a new video:

Replace a single interval and show intensities over time:

Replace a segment of a video with an image:

The image is repeated for the duration of the replacement interval:

Replace a section of a video with constant color frames:

Options  (1)

ConformationMethod  (1)

The frame size is taken from the base video and new videos are conformed to that size:

Replace the second half of a video segment with frames that have a different size and aspect ratio:

By default, frames from new videos are resized using the "Fit" method with black padding:

Specify a different fitting method:

Properties & Relations  (2)

The properties of the original video, apart from duration, are not changed by default:

Compare video properties:

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:

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).

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

BibTeX

@misc{reference.wolfram_2024_videoreplace, author="Wolfram Research", title="{VideoReplace}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/VideoReplace.html}", note=[Accessed: 15-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_videoreplace, organization={Wolfram Research}, title={VideoReplace}, year={2021}, url={https://reference.wolfram.com/language/ref/VideoReplace.html}, note=[Accessed: 15-October-2024 ]}