Re:Show HN: Fileshifter – Easily convert files and videos be...
by natch on Saturday April 07, 2018 @10:16PM
(#16784221)
>I also just want to see the code because i think it's cool
This is not "the" code but here's a script. I can't take credit for it... I don't remember but I probably cobbled it together by taking stack overflow code and making it more friendly. First, you need ffmpeg (ymmv.. this assumes macOS, for others installing ffmpeg is also possible but left as an exercise for the reader):
$ brew install ffmpeg
Then:[edit: fixed some typos]
#!/bin/bash
export OLD_IFS=$IFS
export IFS=''
mkdir -p converted
for a in *.{webm,mkv,ts}
do
ffmpeg -i "$a" -c:v libx264 -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "$a.mp4"
if [[ $? == 0 ]]; then
mv "$a.mp4" converted
fi
done
export IFS=$OLD_IFS
Save as convert-to-mp4.sh then run it in a directory containing files of undesirable types like .webmNot saying this is perfect. Take it as a proof of concept. And there's no web UI, nor would I want one. Suggestions for tweaks welcome.
Re:Show HN: Fileshifter – Easily convert files and videos be...
by josephfrazier on Saturday April 07, 2018 @11:53PM
(#16784522)
> First, you need ffmpeg (ymmv.. this assumes macOS, for others installing ffmpeg is also possible but left as an exercise for the reader):
> $ brew install ffmpeg
FWIW, there's a `brew` fork for linux: https://github.com/Linuxbrew/brew
It's not especially useful in this case as ffmpeg is available in linux package managers, but it's handy for tools that aren't.
Re:Show HN: Fileshifter – Easily convert files and videos be...
by fvargas on Sunday April 08, 2018 @04:28PM
(#16788162)
Yeah, the primary benefit I see is if one fully audits the code and any future updates. Otherwise, self-hosting doesn't confer much in the way of guarantees for security or privacy.
I also just want to see the code because i think it's cool