meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:multimedia:movie [2017/07/19 13:15] – niziak | linux:multimedia:movie [2021/02/07 11:21] (current) – niziak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Movie ====== | ||
| + | |||
| + | ===== Extract frames ===== | ||
| + | * Extract keyframes | ||
| + | * **-hide_banner** we are using this parameter to hide ffmpeg compilation information | ||
| + | * **-vsync vfr**: This is a parameter that tells the filter to use a variable bitrate video synchronization. If we do not use this parameter ffmpeg will fail to find only the keyframes and shoud extract other frames that can be not processed correctly. | ||
| + | <code bash> | ||
| + | * Extract one frame per second | ||
| + | <code bash> | ||
| + | * Extract one frame per 10 seconds | ||
| + | <code bash> | ||
| + | * Extract with different quality / to bmp | ||
| + | <code bash> | ||
| + | <code bash> | ||
| + | * Extract only one frame | ||
| + | <code bash> | ||
| + | |||
| ===== Chroma subsampling ===== | ===== Chroma subsampling ===== | ||
| [[https:// | [[https:// | ||
| Line 7: | Line 24: | ||
| * 4:2:2 - 50Mbit - (H264) for every 4 pixels of luma, there are 2 pixels of colour. Keying can produce bad edges. | * 4:2:2 - 50Mbit - (H264) for every 4 pixels of luma, there are 2 pixels of colour. Keying can produce bad edges. | ||
| * 4:2:0 - 35MBit - (DVD, DV, JPEG, MPEG1, Blueray) - only alternatign lines are sampled for chroma. Chroma vertical resolution is halved. | * 4:2:0 - 35MBit - (DVD, DV, JPEG, MPEG1, Blueray) - only alternatign lines are sampled for chroma. Chroma vertical resolution is halved. | ||
| + | |||
| + | |||
| + | ===== Stabilisation ===== | ||
| + | |||
| + | ==== To remove Little shaking in 1-pass ==== | ||
| + | |||
| + | <code bash> | ||
| + | NOTE: No multithreading. | ||
| + | |||
| + | ==== To completely process shaky video in 2-pass| ==== | ||
| + | |||
| + | FFMpeg already contains plugins **vidstabdetect** and **vidstabtransform** [[http:// | ||
| + | But latest version (supports multithreading) can be downloaded as statically linked binary from: [[https:// | ||
| + | |||
| + | <code bash> | ||
| + | ffmpeg -i $1 -vf vidstabdetect=shakiness=10: | ||
| + | ffmpeg -i $1 -vf vidstabtransform=input=" | ||
| + | </ | ||
| + | NOTE: output from pass1 is also written as video to see motion vectors. | ||
| + | |||
| + | |||
| Line 24: | Line 62: | ||
| The same video encoded using **utvideo** @422p is 78% of **huffyuv**. | The same video encoded using **utvideo** @422p is 78% of **huffyuv**. | ||
| - | ===== mpeg2 ===== | + | ===== MPEG2 ===== |
| Highest quality (qscale 4-5 is far enough) | Highest quality (qscale 4-5 is far enough) | ||
| < | < | ||
| + | ==== DVD ==== | ||
| + | DVD's VOBS can be simply concatenated to one big file: | ||
| + | <code bash>cat ./ | ||
| + | |||
| + | <code bash> | ||
| + | #!/bin/bash -eu | ||
| + | |||
| + | VOBS="" | ||
| + | while read VOB; do | ||
| + | echo ${VOB} | ||
| + | if [ -n " | ||
| + | VOBS=" | ||
| + | fi | ||
| + | VOBS=" | ||
| + | done < <(ls -1 *.VOB) | ||
| + | |||
| + | ffmpeg -i " | ||
| + | </ | ||
| + | More: [[https:// | ||
| + | |||
| ===== H.264 params ===== | ===== H.264 params ===== | ||