
Show HN: Fileshifter – Easily convert files and videos between different formats - mtusman
https://fileshifter.io/converter/
======
Digital-Citizen
Structurally, the service is hosted online as a website, this means one must
upload a copy of their data to be converted. Naturally that raises questions
because there's a lot we don't know about this site: who runs it, what are the
terms of service (I saw none on the site), what are users granting the site
owners to do with uploaded data? Answers to these are almost certainly guesses
as this information is not readily available. The site source code is minified
Javascript; designed to be terse and at the cost of legibility (variable names
are often shortened, useful or long comments eliminated), certainly not the
source code a developer would work with when writing the software.

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.

~~~
bo1024
\- I appreciate these posts that promote software freedom.

\- The tools `convert` and `ffmpeg` should cover your criteria and the
functionality of the site.

~~~
systoll
unoconv too, for the office formats.

~~~
bo1024
Thanks

------
thomasswift
Cool! I think you need a way to get back to the home screen so that someone
can try another conversion. After I did the default png->pdf, there is nothing
to click on to go back and try another conversion, besides editing the URL.
(maybe a link 'try another' or just home) - but cool thanks for sharing! Edit:
on Safari mac 10.13 if that helps

~~~
mtusman
Hey, glad you liked it! I'm working on a new update that does exactly that!
So, thanks for your suggestion.

~~~
mtusman
Edit: Feature has now been implemented

~~~
thomasswift
Wonderful!! I'll give it a try.

------
fma
So...it's like zamzar?

------
stevemk14ebr
Will this be open-sourced? I'd like the idea of a self-hosted version of this.
Good work!

~~~
fvargas
Just curious, why would you want to self-host it?

~~~
stevemk14ebr
Many reasons. Primarily because of security and control of my information.
Secondly because services like these tend to be short-lived and unreliable, if
i host it myself i can trust it's there when i need it. And i hadn't
considered the uploading time issue mentioned in a previous comment, but that
is actually a very good point that self-hosting would solve as well.

I also just want to see the code because i think it's cool

~~~
natch
>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 .webm

Not 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.

~~~
josephfrazier
> 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](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.

------
paultopia
Interesting. I tried to convert an iPhone photo from jpg to pdf (from phone)
and it threw the following error: "C952B34B-95B4-4908-9018-C224DBB753A1.jpeg -
File not in jpg format"

~~~
mtusman
yep, looks like an error at the frontend. I’ll look it to it. Thanks for
reporting it

~~~
mtusman
Error is now fixed

------
michaelvillar
It's nice! Quick feedback for UX improvement: let the user upload a file
first, detect the extension, then ask what file type to convert to.

~~~
mtusman
Thanks for the feedback, I'll take it onboard and try my best to implement it.

