streamaserver/streama

Server-side video conversion for html5-formats

dularion opened this issue · 17 comments

Video-conversion via ffmpeg & HandBrake, triggered both after upload & through a cron-job. I will make it optional to the user whether he wants all 3 codecs (h.264, ogg, and webm) or not.

Ok, I have pushed a first try at h264 video conversion to this branch: https://github.com/dularion/streama/tree/videoConverter

If anyone feels like playing around with it, feel free!

Hmm, it cannot find the bash script in the project root for some reason. im calling it via './convertVideoH264.sh'. works locally. I'm gonna look into it. anyone have any ideas in the meantime?

Log the output of the pwd command to see which directory you're in...
Does Grails have some variable that points to the project root?

Thank you for using #!/bin/sh and not bash :-)

But why HandBrakeCLI instead of just ffmpeg?

One last thing: adding binaries like HandBrakeCLI to git isn't a good idea, you should .gitignore them.

I added it in git on purpose so people wouldnt have to install it :/ I looked at their license and it stated that it could be freely distributed. Why is it not good to add them you think?

The reasoning behind using handbrake instead of ffmpeg is that I saw more people referencing handbrake (in forums etc) when it comes to h264. Other than that no reasoning at all. I could do ffmpeg also, its really not important to me. as long as conversion works and the users are happy :P

Git is not made to work with binary files! Because if you update that file, cloning the repo will download the previous version too and… see where this is going? :) Git can't diff a binary, so it will store all the full versions and the repo will become huge over time. GitHub even made an additional tool for large binary files.

People talk about Handbrake because it has a desktop GUI! On servers, ffmpeg is the most popular tool. It's available in pretty much all operating systems' package managers. Just tell the users to brew / pkg / apt-get / … install ffmpeg.

Ok makes absolute sense. Will use ffmpeg instead and will remove the binary. Thanks for the info, learned something new :)

Btw, since you seem to know a little bit about this stuff, do you know a good ffmpeg h264 execution for me? I tried the following, but there was no sound. Looking around for others now, but there are so many different options that people suggest... its a bit like a jungle.

ffmpeg -i input.avi -an -vcodec libx264 -crf 23 test.mp4

that sounds really fancy and interesting .. But this doesnt work with html5?

ffmpeg is deprecated - you should use avconv instead. It uses the same parameters, but for claritys sake:
ffmpeg -y -i input.mkv -vcodec libx264 -strict experimental output.mp4
avconv -y -i input.mkv -vcodec libx264 -strict experimental output.mp4
This should give you the results you want, but you might have to manuall add in the audiocodec (https://libav.org/avconv.html#Audio-Encoders)

After reading this answer on stackoverflow http://stackoverflow.com/a/9477756/919459 it seems like the whole "deprecated" debate was because of poor wording, and that that is actually not the case

No, it's not deprecated! Where did you get that?!

Here's the news page, it doesn't say anything like that

/data/streama/upload# ffmpeg -y -i input.mkv -vcodec libx264 -strict experimental output.mp4
ffmpeg version 0.8.17-6:0.8.17-1, Copyright (c) 2000-2014 the Libav developers
built on Mar 15 2015 17:00:31 with gcc 4.7.2
The ffmpeg program is only provided for script compatibility and will be removed
in a future release
. It has been deprecated in the Libav project to allow for
incompatible command line syntax improvements in its replacement called avconv
(see Changelog for details). Please use avconv instead.
input.mkv: No such file or directory

Well... :) (on debian, at least)

Edit: Just read your so post dularion, poor wording like you say - my bad then!

@yusiswtor To clarify for people only reading this and not SO, "ffmpeg" the command from the libav project is deprecated. "ffmpeg" the command from the ffmpeg project is not.

Any news on this feature? Looks like you had it running but somehow it didn't make it in the end?

What about h264 nvenc for better speed of conversion?

Any update to this? would really like server-side transcoding. can't wait. :)

Closing this because discussion of transcoding is in issue #440

Should we merge any remaining changes in the videoConverter branch to the transcoder branch and close the videoConverter branch?