Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
VideoTrim
  • See Also
    • VideoSplit
    • VideoDelete
    • VideoExtractFrames
    • VideoFrameList
    • VideoMapTimeSeries
    • VideoFrameMap

    • Formats
    • MP4
    • QuickTime
    • Matroska
    • Ogg
  • Related Guides
    • Video Editing
    • Video Computation: Update History
    • Video Processing
    • See Also
      • VideoSplit
      • VideoDelete
      • VideoExtractFrames
      • VideoFrameList
      • VideoMapTimeSeries
      • VideoFrameMap

      • Formats
      • MP4
      • QuickTime
      • Matroska
      • Ogg
    • Related Guides
      • Video Editing
      • Video Computation: Update History
      • Video Processing

VideoTrim[video,t]

returns the first t seconds of video.

VideoTrim[video,-t]

returns the last t seconds of video.

VideoTrim[video,{t1,t2}]

returns video starting at time t1 and ending at time t2 of video.

VideoTrim[video,{{t11,t12},…}]

returns a list of video objects for all given intervals {ti1,ti2}.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Options  
AudioEncoding  
CompressionLevel  
Applications  
Properties & Relations  
Possible Issues  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • VideoSplit
    • VideoDelete
    • VideoExtractFrames
    • VideoFrameList
    • VideoMapTimeSeries
    • VideoFrameMap

    • Formats
    • MP4
    • QuickTime
    • Matroska
    • Ogg
  • Related Guides
    • Video Editing
    • Video Computation: Update History
    • Video Processing
    • See Also
      • VideoSplit
      • VideoDelete
      • VideoExtractFrames
      • VideoFrameList
      • VideoMapTimeSeries
      • VideoFrameMap

      • Formats
      • MP4
      • QuickTime
      • Matroska
      • Ogg
    • Related Guides
      • Video Editing
      • Video Computation: Update History
      • Video Processing

VideoTrim

VideoTrim[video,t]

returns the first t seconds of video.

VideoTrim[video,-t]

returns the last t seconds of video.

VideoTrim[video,{t1,t2}]

returns video starting at time t1 and ending at time t2 of video.

VideoTrim[video,{{t11,t12},…}]

returns a list of video objects for all given intervals {ti1,ti2}.

Details and Options

  • VideoTrim can be used to either extract interesting parts of a recording or remove uninteresting parts.
  • VideoTrim places the new video under the "Video" directory in $WolframDocumentsDirectory.
  • The time t can be any of the following:
  • ttime given in seconds
    Quantity[t,"unit"]time given in "unit" compatible with seconds
    Quantity[t,"Frames"]time given as number of frames
  • By default, VideoTrim places the new video under the "Video" directory in $WolframDocumentsDirectory.
  • The following options can be specified:
  • AudioEncoding Automaticaudio encoding to use
    CompressionLevel Automaticcompression level to use
    GeneratedAssetFormatAutomaticthe file format of the result
    GeneratedAssetLocation$GeneratedAssetLocationlocation of the generated assets
    OverwriteTargetAutomaticwhether to overwrite an existing file
    SubtitleEncodingAutomaticsubtitle encoding to use
    VideoEncodingAutomaticvideo encoding to use
    VideoTransparencyFalsewhether the output video should have a transparency channel

Examples

open all close all

Basic Examples  (1)

Trim the first 10 seconds from a video:

Trim from second 10 to second 20 of the video:

Scope  (7)

Trim the first 10 seconds of a video:

Trim the last 10 seconds:

Trim from second 10 to second 20:

Trim using a valid time Quantity:

Compute multiple trims on the same video:

Trim the first and last 10 seconds of a video:

Trim a part of a remote video file:

Note that the trimmed video is stored as a local video object:

Options  (2)

AudioEncoding  (1)

By default, the original audio encoding in the file is preserved if possible:

Specify an audio encoding to use:

CompressionLevel  (1)

Generate a trimmed video using default compression:

Use maximum compression:

The choice of encoders affects the amount by which a file can be compressed:

Applications  (3)

Extract an interesting portion of a video based on audio properties.

Import the audio track and use AudioLocalMeasurements to find the time when the audio has the greatest high-frequency content:

Extract the timestamp of the loudest partition:

Trim 3 seconds on either side of the interval:

Extract an interesting portion of a video based on image properties:

Define a function to detect whether an image has almost constant pixel values:

Use VideoMapTimeSeries to apply the function to each frame and plot the result:

Compute the intervals of constant and non-constant frames:

Find and trim the largest non-constant interval:

Use VideoTrim to partition a video file into smaller segments:

Partition the video into fixed-sized chunks of 20 seconds:

Compute and plot the mean intensity per frame for each video partition:

Perform an analysis of mean intensity value per frame on a specific segment:

Apply edge detection to video frames in a specific segment, generating a new video:

Properties & Relations  (4)

If the requested time is beyond the duration of the video, only the available data is returned:

Negative times are also clipped to 0:

Properties of the original video object are typically preserved:

Compare with the properties of the generated video:

It is not always possible to preserve all properties when changing the encoding:

Some audio encodings support specific sample rates:

Video options such as RasterSize and track selection options are used when creating the trimmed video. Create a video object with nondefault option settings:

Trim a portion of the video:

The trimmed video has the specified raster size:

The trimmed video has only the one selected audio track:

Other options have been propagated:

Possible Issues  (1)

An interval containing equal times is considered empty:

An interval containing equal frames is considered to contain a single frame:

See Also

VideoSplit  VideoDelete  VideoExtractFrames  VideoFrameList  VideoMapTimeSeries  VideoFrameMap

Formats: MP4  QuickTime  Matroska  Ogg

Related Guides

    ▪
  • Video Editing
  • ▪
  • Video Computation: Update History
  • ▪
  • Video Processing

History

Introduced in 2020 (12.1) | Updated in 2020 (12.2) ▪ 2021 (12.3)

Wolfram Research (2020), VideoTrim, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoTrim.html (updated 2021).

Text

Wolfram Research (2020), VideoTrim, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoTrim.html (updated 2021).

CMS

Wolfram Language. 2020. "VideoTrim." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/VideoTrim.html.

APA

Wolfram Language. (2020). VideoTrim. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoTrim.html

BibTeX

@misc{reference.wolfram_2025_videotrim, author="Wolfram Research", title="{VideoTrim}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/VideoTrim.html}", note=[Accessed: 04-February-2026]}

BibLaTeX

@online{reference.wolfram_2025_videotrim, organization={Wolfram Research}, title={VideoTrim}, year={2021}, url={https://reference.wolfram.com/language/ref/VideoTrim.html}, note=[Accessed: 04-February-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English