u/Elratum

Made a ffmpeg video converter to H.265 script to save space on my video files
▲ 26 r/ffmpeg+1 crossposts

Made a ffmpeg video converter to H.265 script to save space on my video files

Hello, I would love some feedback.
I have made a Bash script using to convert a bunch of .mp4 files to a newer, less space hungry codec (H.265) without a drop in quality.
It only scan for .mp4 files but can be changed quite easily.
After converting, it append "_cc" to the end of the filename, it will also not convert files who already have that substring.
It will delete the original at the end, but can be changed also if needed, then give you info about the total space saved and how long the script was running
https://github.com/PassPhoenix/ffmpeg_converter_H265/blob/main/ffmpeg_h265_converter_mp4.sh
Is there a better way to go about the wall of "echo -n" I did? The code in general?
It's a very simple script and I am learning

Or here for the code:

#! /usr/bin/bash

input_format="mp4"
datasaved=0
SECONDS=0
number_files_converted=0

for file in *."$input_format"; do

  base_name=$(basename "$file" .$input_format)
  output_file="${base_name}_cc.${input_format}"
  
  if [[ $base_name == *"_cc"* ]]; then
    continue
  fi

  size_vid=$(stat --format "%s" "$file")
  echo "Converting file: $file"
  ffmpeg -hide_banner -loglevel error -i "$file" -c:v libx265 -x265-params log-level=none -crf 28 -c:a copy "$output_file" 
  size_vid_after=$(stat --format "%s" "$output_file") 

  echo -n "Converted $file ("
  echo -n "$size_vid"| numfmt --to iec 
  echo -n ") to $output_file ("
  echo -n "$size_vid_after" | numfmt --to iec 
  echo -n ") Reduced by -"
  echo -n $((size_vid - size_vid_after)) | numfmt --to iec
  echo "."
  ((datasaved+= size_vid - size_vid_after))
  echo -n "Size saved so far: "
  echo $datasaved | numfmt --to iec
  
  printf "\n"

  rm "$file"
  ((number_files_converted++))
done

echo -n "Total saved is "
echo $datasaved | numfmt --to iec
duration=$SECONDS
echo "$((duration / 60)) minutes and $((duration % 60)) seconds elapsed for $number_files_converted files converted."
u/Elratum — 2 days ago

Transferring to protonpass: questions about email masking

Hello, I am very interested in starting to use the proton suite, but I have an issue with transferring password managers that I didn't find information for.
I am currently using Nordpass and is making heavy use of their email masking. What would happen to my accounts and masked emails if I transferred to ProtonPass?
A concrete example: I want to connect to an account that had Nordpass mask, they say, to verify my identity, that they sent a code on my provided email.
Could the mail be lost to the void when I stop paying for Nord?
Do I have to change all my nordpass masked mails to proton masks?
Thank you for the help

reddit.com
u/Elratum — 9 days ago

Received an email 2h ago, it probably won't be long for everyone who bought it on release

u/Elratum — 16 days ago

EDIT: A fix was released, update kmod – 31+20240202-2ubuntu7.2 in your update manager
This is crazy, maintainers discovered the exploit at the same time as the public, leaving them no time to get a patch ready. This is so stupid and inconsiderate from the researcher and the AI firm (mostly the firm since they were the one releasing the informations). It makes the possibility of this exploit being used maliciously way more viable.

openwall.com
u/Elratum — 21 days ago

Don't worry too much, a physical access is needed for this, or running the code on purpose. It's a very simple python code so it is surprising.

cve.org
u/Elratum — 22 days ago