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/07/01 22:23] – [downscale video to 720p mkv] Wulf Rajek | howto:convert-images [2025/05/20 11:23] (current) – [lossy conversion of png to jpg] Wulf Rajek | ||
---|---|---|---|
Line 28: | Line 28: | ||
</ | </ | ||
- | ===== lossless changing container from webm to mkv ===== | + | ===== lossy conversion of png to jpg ===== |
+ | Converts all png files in the directory recursively to jpg | ||
+ | < | ||
+ | find . -iname ' | ||
+ | </ | ||
- | Webm is a container similar | + | ===== png to ico ===== |
+ | To create favicon ico files, the following command creates multiple sizes and stores them in the ico file and keeps transparency. Adjust as required.: | ||
+ | < | ||
+ | convert logo.png -define icon: | ||
+ | </ | ||
+ | |||
+ | ===== lossless changing containers between webm/ | ||
+ | |||
+ | webm/ | ||
< | < | ||
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, m4v -> 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 162: | Line 189: | ||
<code bash processfiles.sh> | <code bash processfiles.sh> | ||
- | bitrateprocess.sh | ||
#!/bin/bash | #!/bin/bash | ||
- | MYFILES=$(find / | + | MYFILES=$(find / |
- | p4") | + | |
SAVEIFS=$IFS | SAVEIFS=$IFS | ||
Line 171: | Line 196: | ||
for FILE in ${MYFILES} | for FILE in ${MYFILES} | ||
do | do | ||
- | bitrate=$(ffprobe -v quiet -select_streams v:0 -show_entri | + | bitrate=$(ffprobe -v quiet - select_streams v:0 -show_entries |
- | es stream=bit_rate -of default=noprint_wrappers=1: | + | |
- | ILE) | + | |
if ! [[ $bitrate =~ ^[0-9]+$ ]]; | if ! [[ $bitrate =~ ^[0-9]+$ ]]; | ||
then | then | ||
Line 185: | Line 208: | ||
done | done | ||
IFS=$SAVEIFS | 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 " | ||
+ | </ | ||
+ | |||
+ | ===== Mono to Stereo MP3 ===== | ||
+ | |||
+ | Conversion using ffmpeg -ac 2 reduces volume by 3db, apparently to keep perceived loudness the same. To maintain the same volume use pan as below. | ||
+ | |||
+ | < | ||
+ | for i in {01..33}; do | ||
+ | ffmpeg -i " | ||
+ | done | ||
</ | </ | ||
howto/convert-images.1719868986.txt.gz · Last modified: by Wulf Rajek