FFmpeg - Encode MPEG-4 Part 2: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
[[Category:FFmpeg]] | [[Category:FFmpeg]] | ||
[[Category:MPEG-4 Part 2]] | [[Category:MPEG-4 Part 2]] | ||
FFmpeg | FFmpeg supports two primary ways to encode MPEG‑4 Part 2 video: using the external Xvid library (libxvid) or FFmpeg’s native mpeg4 encoder. Both produce broadly compatible MPEG‑4 Part 2 output, but they differ in dependency requirements, performance characteristics, and quality at lower bitrates. | ||
<code>ffmpeg -i input.avi -c:v libxvid output.avi</code> | |||
== Context == | |||
<code>ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi</code> | MPEG‑4 Part 2 is used in legacy and AVI-based workflows. FFmpeg supports it through libxvid and the native mpeg4 encoder. | ||
== Encoding Options == | |||
=== Using libxvid === | |||
<code>ffmpeg -i input.avi -c:v libxvid output.avi</code> | |||
=== Using native mpeg4 === | |||
<code>ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi</code> | |||
== FourCC == | |||
Use -vtag to override the default FMP4 FourCC, for example: -vtag xvid. | |||
== Quality Notes == | |||
libxvid generally produces better output at low bitrates, particularly around ~1000 kbit/s for 720p. | |||
== Practical Examples == | |||
=== High-quality Xvid === | |||
<code>ffmpeg -i input.mp4 -c:v libxvid -qscale:v 3 -c:a libmp3lame -qscale:a 3 output.avi</code> | |||
=== Native MPEG4 with Xvid FourCC === | |||
<code>ffmpeg -i input.mp4 -c:v mpeg4 -vtag xvid -b:v 1500k -c:a mp2 output.avi</code> | |||
== References == | |||
* https://trac.ffmpeg.org/wiki/Encode/MPEG-4 | |||
Revision as of 13:55, 14 March 2026
FFmpeg supports two primary ways to encode MPEG‑4 Part 2 video: using the external Xvid library (libxvid) or FFmpeg’s native mpeg4 encoder. Both produce broadly compatible MPEG‑4 Part 2 output, but they differ in dependency requirements, performance characteristics, and quality at lower bitrates.
Context
MPEG‑4 Part 2 is used in legacy and AVI-based workflows. FFmpeg supports it through libxvid and the native mpeg4 encoder.
Encoding Options
Using libxvid
ffmpeg -i input.avi -c:v libxvid output.avi
Using native mpeg4
ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi
FourCC
Use -vtag to override the default FMP4 FourCC, for example: -vtag xvid.
Quality Notes
libxvid generally produces better output at low bitrates, particularly around ~1000 kbit/s for 720p.
Practical Examples
High-quality Xvid
ffmpeg -i input.mp4 -c:v libxvid -qscale:v 3 -c:a libmp3lame -qscale:a 3 output.avi
Native MPEG4 with Xvid FourCC
ffmpeg -i input.mp4 -c:v mpeg4 -vtag xvid -b:v 1500k -c:a mp2 output.avi