howto:convert-images
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howto:convert-images [2024/04/05 12:00] – [downscale video to 720p mkv] Wulf Rajek | howto:convert-images [2025/01/05 18:28] (current) – Wulf Rajek | ||
---|---|---|---|
Line 28: | Line 28: | ||
</ | </ | ||
- | ===== lossless changing | + | ===== lossy conversion of png to jpg ===== |
+ | Converts all png files in the directory recursively to jpg | ||
+ | < | ||
+ | find . -iname ' | ||
+ | </ | ||
+ | |||
+ | ===== lossless changing | ||
- | Webm is a container similar to mkv and can contain various encoded video or audio streams. To change the container | + | webm/mov/mkv/mp4 are container formats |
< | < | ||
ffmpeg -i file.webm -c:a copy -c:v copy file.mkv | ffmpeg -i file.webm -c:a copy -c:v copy file.mkv | ||
# | # | ||
- | find . -name ' | + | find . -iname ' |
- | #find . -type f -name ' | + | #find . -type f -iname ' |
+ | |||
+ | #lossless change container mkv, webm, mov -> mp4 | ||
+ | find . -type f \( -iname " | ||
+ | ffmpeg -i " | ||
+ | done | ||
</ | </ | ||
- | ===== change container mkv < | + | ===== high quality conversion to mp4 ===== |
- | + | ||
- | To only change the container use the following example command - provided the codecs are compatible with mp4. The quality and size stays the same: | + | |
< | < | ||
- | ffmpeg -i input.mkv | + | #High quality non-mp4 to mp4 conversion |
+ | find . -type f \( -iname " | ||
+ | | ||
+ | done | ||
</ | </ | ||
+ | ===== find all non-mp4 files ===== | ||
+ | < | ||
+ | #Find non-mp4 files | ||
+ | find . -type f -not \( -iname " | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
===== downscale video to 720p mkv ===== | ===== downscale video to 720p mkv ===== | ||
Line 157: | Line 178: | ||
< | < | ||
echo;read -rsn1 -p "Press any key to continue . . ."; | echo;read -rsn1 -p "Press any key to continue . . ."; | ||
+ | </ | ||
+ | |||
+ | ===== Reencode videos with high bitrate ===== | ||
+ | |||
+ | <code bash processfiles.sh> | ||
+ | #!/bin/bash | ||
+ | MYFILES=$(find / | ||
+ | SAVEIFS=$IFS | ||
+ | |||
+ | IFS=$(echo -en " | ||
+ | for FILE in ${MYFILES} | ||
+ | do | ||
+ | bitrate=$(ffprobe -v quiet - select_streams v:0 -show_entries stream=bit_rate -of default=noprint_wrappers=1: | ||
+ | if ! [[ $bitrate =~ ^[0-9]+$ ]]; | ||
+ | then | ||
+ | continue | ||
+ | fi | ||
+ | if [ $bitrate -gt 8000000 ] | ||
+ | then | ||
+ | echo $bitrate" | ||
+ | video_downscale.sh " | ||
+ | fi | ||
+ | done | ||
+ | IFS=$SAVEIFS | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== 3D VR SBS to 2D ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | < | ||
+ | ffmpeg -i input.mp4 -vf v360=input=equirect: | ||
+ | </ | ||
+ | |||
+ | https:// | ||
+ | |||
+ | < | ||
+ | ffmpeg -i input.mkv -vf stereo3d=sbsl: | ||
+ | </ | ||
+ | Use sbsl2:ml or -aspect 16:9 if the aspect ratio is wrong | ||
+ | |||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | https:// | ||
+ | < | ||
+ | ffmpeg -i equirectangular.mp4 -filter:v " | ||
</ | </ |
howto/convert-images.1712314859.txt.gz · Last modified: 2024/04/05 12:00 by Wulf Rajek