handbrake-cli?


27 posts   Page 1 of 2   1, 2
by joshhighley » Tue Nov 06, 2012 2:22 am
Is the handbrake-cli package available for any of the RPi distros? I've installed Arch and it's not there (no armv6h build in the repos). I downloaded a source list for Raspbian and it's not in there either.

FWIW, I'm trying to convert mpeg2 recordings to h264 so I can play them on my Roku. ffmpeg is giving me fits on Arch, and I've used handbrake-cli successfully on a different arm platform (pogoplug).
Posts: 26
Joined: Mon Nov 05, 2012 9:36 pm
Location: Kansas City, MO, USA
by ghans » Tue Nov 06, 2012 9:48 am
Doesn't look like it. Did you consider using OpenMAX for hardware accelerated
encoding ?


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4630
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by joshhighley » Tue Nov 06, 2012 2:44 pm
I searched for openmax and omx packages on Arch but didn't find anything. Also, from what I can tell, openmax is simply an API spec. I need a command-line program on top of an openmax implementation -- I'm not running a desktop environment.
Posts: 26
Joined: Mon Nov 05, 2012 9:36 pm
Location: Kansas City, MO, USA
by ghans » Tue Nov 06, 2012 6:33 pm
Did you try the hello_encode example on github ?


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4630
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by joshhighley » Tue Nov 06, 2012 6:52 pm
No. Example of....openmax or what?

I found a reference to /opt/vc/src/hello_pi in the RPi Quick Start guide -- is this what you're referring too? The Arch image has the /opt/vc directory, but no src directory. I looked around the RPi github repo but couldn't find it there either.
Posts: 26
Joined: Mon Nov 05, 2012 9:36 pm
Location: Kansas City, MO, USA
by ghans » Tue Nov 06, 2012 8:52 pm
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4630
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by joshhighley » Tue Nov 06, 2012 8:58 pm
I don't know what you're talking about. Please re-read my previous post. I'm not sure what example you're referring to, and I can't find any hello_encode example either.
Posts: 26
Joined: Mon Nov 05, 2012 9:36 pm
Location: Kansas City, MO, USA
by ghans » Tue Nov 06, 2012 9:25 pm
The link I posted points to the source of a encoder built on top of
the OpenMAX API. I believe it might be of interest to you.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4630
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by joshhighley » Wed Nov 07, 2012 7:50 pm
Sorry, your phrase "It's only rudimentary" doesn't show as a link, just as normal text, so I didn't realize it pointed to more info. Thanks.
Posts: 26
Joined: Mon Nov 05, 2012 9:36 pm
Location: Kansas City, MO, USA
by ghans » Wed Nov 07, 2012 9:11 pm
See my sig.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4630
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by flyinghappy » Wed Nov 07, 2012 10:05 pm
Here is a link that has the tar.gz for handbrake-cli, then you can build it yourself...

http://code.google.com/p/swiss-army-kni ... z&can=2&q=
Pi with ArchLinux running a minidlna/samba home server
Posts: 112
Joined: Mon Nov 05, 2012 5:31 pm
by joshhighley » Thu Nov 08, 2012 12:44 am
Do you know if handbrake-cli will use the hardware capabilities for mpeg2 and h264? Or, do I basically have to compile the openmax programs to get hardware support?
Posts: 26
Joined: Mon Nov 05, 2012 9:36 pm
Location: Kansas City, MO, USA
by joshhighley » Thu Nov 08, 2012 12:49 am
To sort of answer my own question, I believe handbrake is software only -- no hardware support. Ugh. I guess I'll have to dig into the omx examples and hope I can figure out transcoding.
Posts: 26
Joined: Mon Nov 05, 2012 9:36 pm
Location: Kansas City, MO, USA
by meff » Tue Jan 01, 2013 1:27 pm
I have compiled HandBrakeCLI for the Pi and placed it in my package repo;
http://honeybadger.zapto.org/software/p ... epository/

Hope it helps.
Posts: 5
Joined: Sun Dec 09, 2012 10:54 am
by ghans » Tue Jan 01, 2013 1:39 pm
To anybody looking for GPU support , there has been some
progess on the transcoding front :

https://github.com/arjenv/omxtx/

Keyword "omxtx" will get you the main thread.
Let's see if any Handbrake hacker is interested ...


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 4630
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by Hoagie » Fri Feb 08, 2013 8:10 am
meff wrote:I have compiled HandBrakeCLI for the Pi and placed it in my package repo;
http://honeybadger.zapto.org/software/p ... epository/

Hope it helps.


Hi,

I tried installing your package but it doesn't seem to have put handbrakecli anywhere on my system.

Any ideas?

Geoff.
Posts: 94
Joined: Sun Sep 23, 2012 7:19 pm
by meff » Tue Feb 12, 2013 11:00 pm
Hi Geoff,

When I installed it, typing;
locate HandBrakeCLI
at the command line gives me the location as /usr/bin/HandBrakeCLI.

I would expect it to be in a similar location on your system, unless you have arranged otherwise. Have you tried running the program?
Posts: 5
Joined: Sun Dec 09, 2012 10:54 am
by Hoagie » Wed Feb 13, 2013 4:03 pm
Since that post, I've built handbrake from source anyway. Now my problem is an illegal instruction when using the x264 codec. One day I'll find the time to dig a bit deeper.

Thanks,
Geoff
Posts: 94
Joined: Sun Sep 23, 2012 7:19 pm
by meff » Thu Feb 14, 2013 9:17 pm
Hi Geoff,

I've seen some issues with the x264 codec. I've also had some people contact me about it. I am looking in to it but for now I would suggest using;

HandBrakeCLI -i myInput.vid -o myOutput.mkv preset="high"

This has worked for me with the version in the repo.
Posts: 5
Joined: Sun Dec 09, 2012 10:54 am
by Hoagie » Mon Feb 18, 2013 12:58 pm
Thanks, good to know it's not just me. I like the x264 CODEC as I know it plays well on everything I use. I'll give the default mpeg 4 a go and see if I like it.

Cheers,
Geoff.
Posts: 94
Joined: Sun Sep 23, 2012 7:19 pm
by meff » Sat Feb 23, 2013 12:07 pm
As far as I am aware, the 'high' preset does use the x264 codec. Everything I have tried with this has come out looking really good.
Posts: 5
Joined: Sun Dec 09, 2012 10:54 am
by Hoagie » Tue Feb 26, 2013 7:19 am
Hi,

I tried the --preset="high" option and it said it was using an MP4 codec, but no mention of x264. The result looks great on a Nexus 7 screen though, so I think I'll stick with that for now.

Basically, thanks. You made me remove my x264 blinkers and now I'm very happy with the results.

Geoff.
Posts: 94
Joined: Sun Sep 23, 2012 7:19 pm
by Hoagie » Sat Mar 02, 2013 7:21 am
I now have handbrakecli working with x264.
It seems that handbrake ignores the libx264 on your system and builds its own. By default it builds it with the neon stuff enabled. The Pi cpu doesn't have neon. To make it build an x264 that works do this...

Edit ./contrib/x264/module.defs: in the handbrake source.

Add --disable-asm to the line that starts
X264.CONFIGURE.extra =

I'm testing it now and will let you know in about a week (yes, its that slow) whether it's any good.
Posts: 94
Joined: Sun Sep 23, 2012 7:19 pm
by damogran » Wed Mar 27, 2013 11:40 am
interesting post. would that mean i could convert VC1 to h264 on the pi using the handbrake comandline interface?
Posts: 5
Joined: Sat Nov 03, 2012 12:16 pm
by damogran » Wed Mar 27, 2013 12:20 pm
hey hey, this works, sort of.

Code: Select all
pi@raspbmc:/mnt$ HandBrakeCLI -i blubb/title00.mkv -o ~/blubb.mkv preset="high" -a none
[13:10:36] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 20/22/2/2, aspect 16:9, PAR 1:1
[13:10:36] scan: title (0) job->width:1920, job->height:1040
Scanning title 1...
[13:10:36] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: blubb/title00.mkv
  + duration: 01:39:56
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 20/22/2/2
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:06:40
    + 2: cells 0->0, 0 blocks, duration 00:07:38
    + 3: cells 0->0, 0 blocks, duration 00:09:30
    + 4: cells 0->0, 0 blocks, duration 00:08:43
    + 5: cells 0->0, 0 blocks, duration 00:08:44
    + 6: cells 0->0, 0 blocks, duration 00:05:16
    + 7: cells 0->0, 0 blocks, duration 00:09:20
    + 8: cells 0->0, 0 blocks, duration 00:08:02
    + 9: cells 0->0, 0 blocks, duration 00:04:03
    + 10: cells 0->0, 0 blocks, duration 00:09:08
    + 11: cells 0->0, 0 blocks, duration 00:09:23
    + 12: cells 0->0, 0 blocks, duration 00:13:22
  + audio tracks:
    + 1, English (DTS) (5.1 ch) (iso639-2: eng), 48000Hz, 1536000bps
  + subtitle tracks:
[13:10:36] 1 job(s) to process
[13:10:36] starting job
[13:10:36] sync: expecting 143766 video frames
[13:10:36] job configuration:
[13:10:36]  * source
[13:10:36]    + blubb/title00.mkv
[13:10:36]    + title 1, chapter(s) 1 to 12
[13:10:36]    + container: matroska,webm
[13:10:36]    + data rate: 1536 kbps
[13:10:36]  * destination
[13:10:36]    + /home/pi/blubb.mkv
[13:10:36]    + container: Matroska (.mkv)
[13:10:36]  * video track
[13:10:36]    + decoder: h264
[13:10:36]    + frame rate: same as source (around 23.976 fps)
[13:10:36]    + dimensions: 1920 * 1080 -> 1920 * 1040, crop 20/22/2/2, mod 0
[13:10:36]    + encoder: MPEG-4 (FFmpeg)
[13:10:36]      + bitrate: 1000 kbps, pass: 0
Encoding: task 1 of 1, 0.00 %[13:10:40] reader: first SCR 0 id 0x0 DTS 0
Encoding: task 1 of 1, 0.00 %[13:10:40] encavcodecInit: MPEG-4 ASP encoder
Encoding: task 1 of 1, 0.05 % (0.39 fps, avg 0.46 fps, ETA 87h31m09s)^CSignal 2 received, terminating - do it again in case it gets stuck
Encoding: task 1 of 1, 0.05 % (0.39 fps, avg 0.46 fps, ETA 87h31m09s)[13:13:19] work: average encoding speed for job is 0.456081 fps
[13:13:19] mux: track 0, 0 frames, 0 bytes, 0.00 kbps, fifo 64
[13:13:19] sync: got 69 frames, 143766 expected
[13:13:19] reader: done. 1 scr changes
[13:13:20] h264-decoder done: 95 frames, 0 decoder errors, 0 drops
vcgencmd codec_enabled MPG2[13:13:21] render: lost time: 0 (0 frames)
[13:13:21] render: gained time: 0 (0 frames) (0 not accounted for)

HandBrake has exited.
pi@raspbmc:/mnt$ vcgencmd codec_enabled MPG2
MPG2=enabled
pi@raspbmc:/mnt$ vcgencmd codec_enabled WVC1
WVC1=enabled
pi@raspbmc:/mnt$



mh, tought this would use the hardware for encoding, got the VC1 and MPG2 licence installed. any idea why i only got avg 0.46 fps?


thanks!
Posts: 5
Joined: Sat Nov 03, 2012 12:16 pm