in 2025 still a lot of browsers are not x265 compatible (firefox 1.141 is)

the best up to know: (it reduces the video size resolution by 50% and reencode audio to mp3, because firefox seems to have problems with ogg or aac in mp4 X-D)

su - root
apt update && apt install ffmpeg
# Ctrl+D # log off root
vim /scripts/reencode_x264_half_size.sh

#!/bin/bash
echo "=== re encoding all video.mp4 in the current directory via ffmpeg and x264 plus reducing resolution by HALF! ==="
for f in *.mp4 ; do
   time ffmpeg -i "$f" -vf "scale=trunc(iw/4)*2:trunc(ih/4)*2" -c:v libx264 -c:a mp3 -crf 28 "$f".half-size.x264.mp3.mp4
done

alternatively: recompress with x265

much stronger compression than x264

vim /scripts/reencode_x265.sh
#!/bin/bash
echo "=== re encoding all video.mp4 files in the current directory via ffmpeg and x265 ==="
# for $FILENAME in ./*.mp4; do
for f in *.mp4 ; do 
  time ffmpeg -i "$f" -vcodec libx265 -crf 28 -c:a mp3 "$f".x265.mp3.mp4
done

test if browser is x265+mp3 audio compatible (please be patient sound playback starts after sec10):

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin