doc:appunti:linux:video:ffmpeg_final_rendering
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:linux:video:ffmpeg_final_rendering [2023/11/13 10:46] – [How to probe a video] niccolo | doc:appunti:linux:video:ffmpeg_final_rendering [2023/11/13 11:39] – [Encoding for High Definition Video] niccolo | ||
---|---|---|---|
Line 16: | Line 16: | ||
^ Basic x264 | Preset: **slow** (or less), Tuning: **film**, Profile: **High**, IDC Level: **Auto** | | ^ Basic x264 | Preset: **slow** (or less), Tuning: **film**, Profile: **High**, IDC Level: **Auto** | | ||
^ Video encoding | ^ Video encoding | ||
- | ^ Pixel format | + | ^ Pixel format |
^ Bits per sample | ^ Bits per sample | ||
- | ^ Color range | + | ^ Color range |
^ Audio codec | < | ^ Audio codec | < | ||
^ Audio bitrate | ^ Audio bitrate | ||
Line 39: | Line 39: | ||
" | " | ||
</ | </ | ||
+ | |||
+ | ===== Pixel format considerations ===== | ||
+ | |||
+ | We used the **yuvj420p pixel format**. What does it means? | ||
+ | |||
+ | First of all consider the **420** code; this means tat for each matrix of 4x2 pixels the stream encode all the values for the luminance, only 2 values for the chrominance on the X axis and zero values for the chrominance on the Y axis. This figure explains clearly the 4:4:4, 4:2:2 and 4:2:0 subsampling methods: | ||
+ | |||
+ | {{subsampling.png? | ||
+ | |||
+ | Is file size is not a concern, we might ask ourselves whether a pixel format with less loss of chroma information would be preferable. Obviously is useless to add more chroma information if the final rendering has the same resolution of the original video, but if we are **scaling down** the video resolution we may **retain chroma information** using a different pixel format. | ||
+ | |||
+ | The fact is that **in movies 4:2:0 is almost lossless visually**, which is why it can be found used in Blu-ray discs and a lot of modern video cameras. There is virtually no advantage to using 4:4:4 for consuming video content. | ||
+ | |||
+ | Furthermore, | ||
===== How to probe a video ===== | ===== How to probe a video ===== | ||
+ | |||
+ | How to get the **piexel format**: | ||
+ | |||
+ | < | ||
+ | ffprobe -loglevel error \ | ||
+ | -show_entries stream=pix_fmt \ | ||
+ | -select_streams v YDXJ4050.mp4 | ||
+ | </ | ||
How to get the **bits per raw sample**: | How to get the **bits per raw sample**: | ||
Line 54: | Line 76: | ||
* **[[https:// | * **[[https:// | ||
* **[[https:// | * **[[https:// | ||
+ | * **[[https:// | ||
+ | * **[[https:// | ||
doc/appunti/linux/video/ffmpeg_final_rendering.txt · Last modified: 2024/07/31 07:57 by niccolo