Handbrake Web Status - PHP

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
FastLaneJB
Posts: 3
Joined: Tue Oct 06, 2009 3:38 pm

Handbrake Web Status - PHP

Post by FastLaneJB »

Hi all,

I've made a really rough PHP program that will generate a status page to show HandBrake encode progress. It's really nothing fancy (Read butt ugly :lol:), there's no error checking yet but I made it for myself but am sharing to this great community it might be useful to others. All you should need is a webserver with PHP and PHP-GD installed. No license added in but feel free to hack / copy as you wish. If you've got some nice changes though please do share back :)

My reason for making this is I've made a VM which does my encoding. I drop a video into the Samba share and it'll start encoding it automatically. When it's finished it puts it into a complete share for me to copy back off again. So it's all automatic but hence not too easy to see the progress of an encode so that's where this website comes in. I'll share more on the VM if people are interested and scripts though it's not quite finished yet.

You can pull this down from git at https://github.com/FastLaneJB/handbrake-web

When running an encode you need to pipe the output out to 2 files which must be in a location the web app can read. So just add this to the end and change the paths as needed...

Code: Select all

2> /storage/progress/encode_info > /storage/progress/encode_progress
So your encode line might look like this...

Code: Select all

HandBrakeCLI --verbose 1 --input "movie.mkv" --main-feature --output "encoded.mkv" --format mkv --markers --encoder x264 --quality 24 --vfr --aencoder faac --ab 128 2> /storage/progress/encode_info > /storage/progress/encode_progress
Then put the files from git into your webserver in the root or a subfolder. Then edit the config.php to point to the files that you make from the HandBrake CLI. Fire off an encode and then go to the website to hopefully see the progress.

And that is pretty much it. I imagine this isn't useful to many but hopefully useful to some. If there's enough demand I might well improve on it but otherwise it's just a quick Sunday project for myself :)

Thanks all.
Post Reply