is an option for Export and other functions that specifies the video encoding to use when creating a video file.
VideoEncoding
is an option for Export and other functions that specifies the video encoding to use when creating a video file.
Details
- VideoEncoding can be set to any available encoder listed in $VideoEncoders.
- For some encoders, the following suboptions can be provided:
-
"EncodingSpeed" encoding speed, a value between 0 (slowest) and 1 (fastest) "EncodingTune" tunings to be applied when encoding - Most H264 and H265 encoders can take the "EncodingSpeed" suboption.
- The "EncodingTune" settings are encoder dependent and are used to optimize encoding for specific content types such as grainy images, still images, etc. Some available encoding tunes are:
-
"Animation" optimized for animations and cartoons "Film" optimized for high-quality movies with less deblocking "StillImage" optimized for encoding still images "FastDecode" optimized for fast decoding "ZeroLatency" optimized for low-latency streaming
Examples
open all close allBasic Examples (1)
By default, the audio codec used to generate a file is automatically chosen:
v = Video["http://exampledata.wolfram.com/office.ts"];
Export["file.mkv", v];
Import["file.mkv", "VideoEncoding"]Check for available audio codecs supported for a format:
$VideoEncoders["Matroska"][[All, 1]]Export["file.mkv", v, VideoEncoding -> "H263"];
Import["file.mkv", "VideoEncoding"]Scope (4)
Specify a video encoding for video generation:
v = VideoGenerator[RandomImage[], VideoEncoding -> "VP9"];Information[v, "VideoTracks"]In general, the video encoding is automatically chosen depending on the input data to minimize use of resources:
v = VideoCombine[{Video["ExampleData/bullfinch.mkv"], ExampleData[{"Audio", "PianoScale"}]}];
Information[v, "VideoTracks"]Using a specific encoder will force all video tracks to be re-encoded:
v = VideoCombine[{Video["ExampleData/bullfinch.mkv"], ExampleData[{"Audio", "PianoScale"}]}, VideoEncoding -> "JPEG2000"];
Information[v, "VideoTracks"]VideoGenerator[RandomImage[], 5, VideoEncoding -> {"LIBX264", "EncodingSpeed" -> 0}];//AbsoluteTimingUse the fastest available encoding speed:
VideoGenerator[RandomImage[], 5, VideoEncoding -> {"LIBX264", "EncodingSpeed" -> 1}];//AbsoluteTimingUse a specific tuning when encoding the video:
VideoGenerator[RandomImage[], VideoEncoding -> {"LIBX264", "EncodingTune" -> "StillImage"}]Related Guides
Text
Wolfram Research (2020), VideoEncoding, Wolfram Language function, https://reference.wolfram.com/language/ref/VideoEncoding.html (updated 2022).
CMS
Wolfram Language. 2020. "VideoEncoding." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/VideoEncoding.html.
APA
Wolfram Language. (2020). VideoEncoding. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VideoEncoding.html
BibTeX
@misc{reference.wolfram_2026_videoencoding, author="Wolfram Research", title="{VideoEncoding}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/VideoEncoding.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_videoencoding, organization={Wolfram Research}, title={VideoEncoding}, year={2022}, url={https://reference.wolfram.com/language/ref/VideoEncoding.html}, note=[Accessed: 15-June-2026]}