Show HN: Fileshifter – Easily convert files and videos between different formats
fileshifter.io
fileshifter.io
How could this have been implemented in a way that obviates all of these show-stopper failings? Respect users' software freedom by offering users one or more programs to do the conversion jobs with reasonable default settings. Distribute complete corresponding source code alongside the rest of the site so as to let the user host an instance of the site on their own. Users so inclined can set this up for themselves and others, or use their software freedom to end up with a conversion service they don't need to guess about.
To those that are interested in understand out how the website works, the process goes as follows: the files are uploaded to the server and then uploaded to a private s3 bucket where the user will have an hour to download the converted content via a presigned url after which it will be permanently deleted. Furthermore, as soon as the file is converted, the original file is deleted from the server. In hindsight, I should have shipped an "about" page explaining this process.
- The tools `convert` and `ffmpeg` should cover your criteria and the functionality of the site.
Unoconv tool [2], recommended in another comment here, is also great to convert documents to and from formats that are supported by OpenOffice (LibreOffice?).
Pandoc [3] is also a worthy option to convert between document formats.
[1] : https://www.imagemagick.org/script/convert.php, https://www.lifewire.com/convert-linux-command-unix-command-...
[2] : http://dag.wiee.rs/home-made/unoconv/
[3] : http://pandoc.org/
$ convert input-file.jpg output-file.pdf
$ ffmpeg -i input-file.mov output-file.mp4 $ ffmpeg -i input-file.mov -c copy output-file.mp4
This works if the output container format supports the codecs used by the input file, which should be the case for most mov->mp4 conversions.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.
> $ 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.
The difference is the web app runs within the browser sandbox while the CLI executes with user permissions.