- Encode video and audio to
.wmvfiles on Linux: WMV3 (Windows Media Video 9, Simple/Main profile) video and WMA 9 Standard or WMA 10 Professional audio. - The files follow the layout of files written by Microsoft's Windows Media Format SDK 11, so software that only accepts those can read them.
Give any video or audio file that FFmpeg reads:
cargo run --release --bin wmv3-encode -- -i in.mp4 --bitrate 800 -o out.wmv- The first video and audio stream are used. The video keeps its size and frame rate unless you give
--scale WxHor--fps N/D. The audio becomes stereo or mono at a WMA sample rate, and stays in step with the video. --no-audioor--no-videoleaves a stream out. A file without video is audio only, so name it.wma.--audio FILEtakes the sound from another file. That sound starts with the video.--qualitysets the quantizer from 1 (best) to 31 (smallest). The default is 6.--bitratesets a video bit rate in kbit/s instead. The encoder then picks the quantizer of each frame so a player that buffers for the 3 s preroll does not run out of data. The rate counts the video data. The file adds a few percent of ASF overhead. If the rate is too low even at the coarsest quantizer, the encoder warns.--key-intervalsets the distance between key frames in frames. The default is 300. Scene cuts also start a key frame.--audio-bitratesets the audio bit rate in kbit/s. The default is 128.--audio-codec prowrites WMA 10 Professional, the audio of Microsoft's own sample files, instead of WMA 9 Standard. It sounds better at the same rate.
You can also pipe raw YUV 4:2:0 frames in with --size:
ffmpeg -i in.mp4 -f rawvideo -pix_fmt yuv420p - |
wmv3-encode --size 1280x720 --fps 30000/1001 --audio in.mp4 -o out.wmvThe video encoder uses I and P frames. Expect larger files than Microsoft's encoder gives at the same quality. The audio is constant bit rate.
GPL-3.0-or-later. The code tables in crates/ are ported from FFmpeg and stay under FFmpeg's LGPL-2.1-or-later.
You need FFmpeg's development libraries (8.1) and clang. See DEVELOPMENT.md for building without FFmpeg, running the tests and how the output is checked.