FFmpeg - Encode MPEG-4 Part 2: Difference between revisions
m Knowledgebaseadmin moved page FFMPEG - Encode MPEG-4 Part 2 to FFmpeg - Encode MPEG-4 Part 2 |
No edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
FFmpeg | [[Category:FFmpeg]] | ||
<code>ffmpeg -i input.avi -c:v libxvid output.avi</code> | [[Category:MPEG‑4 Part 2]] | ||
FFmpeg provides two primary ways to encode MPEG‑4 Part 2 video: the external libxvid library and FFmpeg’s native mpeg4 encoder. Both generate broadly compatible MPEG‑4 Part 2 output suitable for AVI‑based and legacy workflows. This article explains the differences, when to use each option, how to control FourCC behaviour, and practical examples. | |||
<code>ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi</code>< | |||
== Context == | |||
MPEG‑4 Part 2 (sometimes simply “MPEG‑4 Visual”) is an older but still widely supported video compression standard. It remains relevant for: | |||
* Legacy systems and appliances | |||
* AVI‑based delivery pipelines | |||
* Devices that pre‑date widespread H.264 adoption | |||
* Archival scenarios where compatibility is more important than efficiency | |||
FFmpeg offers two encoders: | |||
* libxvid — external Xvid library, quality‑focused | |||
* mpeg4 — FFmpeg’s native MPEG‑4 Part 2 encoder | |||
== Encoding Options == | |||
=== Using libxvid (Xvid Encoder) === | |||
<code> | |||
ffmpeg -i input.avi -c:v libxvid output.avi | |||
</code> | |||
=== Using the Native FFmpeg mpeg4 Encoder === | |||
<code> | |||
ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi | |||
</code> | |||
== FourCC == | |||
Use -vtag to override the default FMP4 FourCC. Example: | |||
<code> | |||
-vtag xvid | |||
</code> | |||
== Quality Notes == | |||
libxvid generally produces higher quality at low bitrates (~1000 kbit/s for 720p). The native encoder is faster and dependency‑free. | |||
== Practical Examples == | |||
=== High‑Quality Xvid Encoding === | |||
<code> | |||
ffmpeg -i input.mp4 -c:v libxvid -qscale:v 3 -c:a libmp3lame -qscale:a 3 output.avi | |||
</code> | |||
=== Native MPEG‑4 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 | |||
Latest revision as of 14:35, 14 March 2026
FFmpeg provides two primary ways to encode MPEG‑4 Part 2 video: the external libxvid library and FFmpeg’s native mpeg4 encoder. Both generate broadly compatible MPEG‑4 Part 2 output suitable for AVI‑based and legacy workflows. This article explains the differences, when to use each option, how to control FourCC behaviour, and practical examples.
Context
MPEG‑4 Part 2 (sometimes simply “MPEG‑4 Visual”) is an older but still widely supported video compression standard. It remains relevant for:
- Legacy systems and appliances
- AVI‑based delivery pipelines
- Devices that pre‑date widespread H.264 adoption
- Archival scenarios where compatibility is more important than efficiency
FFmpeg offers two encoders:
- libxvid — external Xvid library, quality‑focused
- mpeg4 — FFmpeg’s native MPEG‑4 Part 2 encoder
Encoding Options
Using libxvid (Xvid Encoder)
ffmpeg -i input.avi -c:v libxvid output.avi
Using the Native FFmpeg mpeg4 Encoder
ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi
FourCC
Use -vtag to override the default FMP4 FourCC. Example:
-vtag xvid
Quality Notes
libxvid generally produces higher quality at low bitrates (~1000 kbit/s for 720p). The native encoder is faster and dependency‑free.
Practical Examples
High‑Quality Xvid Encoding
ffmpeg -i input.mp4 -c:v libxvid -qscale:v 3 -c:a libmp3lame -qscale:a 3 output.avi
Native MPEG‑4 with Xvid FourCC
ffmpeg -i input.mp4 -c:v mpeg4 -vtag xvid -b:v 1500k -c:a mp2 output.avi