Coburn
Posts: 78
Joined: Tue Sep 06, 2011 2:57 am
Contact: Website

Re: Raspberry Pi Video Encoding...

Fri Nov 25, 2011 12:21 am

Forgive me if this has been posted already, but I was wondering if the Raspberry Pi has the guts (especially that GPU) to handle video encoding tasks?

I understand that the \'pi can decode 1080p video thanks to the GPU, but what about video encoding? Will the GPU help assist the video conversion? I have attempted to do video encoding on a ARM5TE SheevaPlug without a GPU... Let\'s just say that I only managed to get 6 frames per second at the most.

What I wish to do is:
1) Put a \"video encoding\" linux OS on a SD Card (ffmpeg, mencoder, etc)
2) load the input movies (mostly 720p H264 anime episodes in my case) onto the SD Card, in another partition.
3) make a shell script to kick mencoder/ffmpeg into gear and start transcoding (not sure if that\'s the right word to use?) media files.
4) copy the newly transcoded files over to USB etc for playback on another device.

Is it possible to do so or will the RPi explode into flames? At the moment, I\'m using my Core i3 laptop but I\'d like something I can leave running on a battery and it can be quietly minding it\'s own business. Maybe even get it to beep (via speaker) once it\'s done the deed.

Cheers.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5202
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Raspberry Pi Video Encoding...

Fri Nov 25, 2011 12:37 am

Fraid not - we don\'t have ffmpeg integration. We\'ll start bringing stuff like that online when we have cameras next year, but it\'s not going to be in the first firmware drop. (So yes, the board has the guts, but we\'re not providing the software to let you do that out of the box - it\'s not a first-tier requirement for the device.)
Director of Communications, Raspberry Pi

rotmoset
Posts: 9
Joined: Thu Nov 24, 2011 8:32 pm
Contact: Website

Re: Raspberry Pi Video Encoding...

Fri Nov 25, 2011 1:14 am

[quote][/quote]

Interesting. I currently am transcoding lots of file with ffmpeg in real time to stream my video collection to my ipad. I use my high-end windows pc for this task which requires that it stays powered up most of the time.

If I could unload this task to a rasp-pi it would be truly great.

Coburn
Posts: 78
Joined: Tue Sep 06, 2011 2:57 am
Contact: Website

Re: Raspberry Pi Video Encoding...

Fri Nov 25, 2011 1:45 am

[quote]Quote from liz on November 25, 2011, 00:37
Fraid not - we don\'t have ffmpeg integration. We\'ll start bringing stuff like that online when we have cameras next year, but it\'s not going to be in the first firmware drop. (So yes, the board has the guts, but we\'re not providing the software to let you do that out of the box - it\'s not a first-tier requirement for the device.)[/quote]

Thanks liz for confirming that. If a firmware does appear to support accelerated encoding sometime soon, the Raspberry Pi might just stop me from buying a PandaBoard to do some video encoding on... :P

Then again, I could possibly poke around or some other bright spark might hack that functionality into a build of ffmpeg. Although, ffmpeg will still work on a non-integrated setup, however I suspect we\'d only get a poor frame rate (maybe ~5Fps at the most?).

But yeah, I was thinking of the idea, I could have a little video converter box running off a USB port, quietly converting my anime to another format so my Iconia Tab can decode it - some BluRay anime makes the tablet bog down and video becomes pixel soup.

Let\'s see what other people have to say.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5202
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Raspberry Pi Video Encoding...

Fri Nov 25, 2011 1:15 pm

If you can bear to wait, we\'ll have video encode next year to go with the camera add-on. It\'s simply that because it\'s a device without a camera on board which is aimed at schoolkids, we made a judgment call and decided that the resources needed to implement it were probably better used elsewhere!
Director of Communications, Raspberry Pi

vman81
Posts: 31
Joined: Wed Nov 02, 2011 11:13 am

Re: Raspberry Pi Video Encoding...

Fri Nov 25, 2011 1:55 pm

I\'ve got ~3.5TB of video that\'s mostly in divx/xvid that I\'d LOVE to transcode to H264, but I don\'t want to use my current server (atom330) to start that task.. I\'m hoping for a hardware solution, and the RPI might be it? If it can encode 1080p in realtime in hardware, I\'m curious what I could expect from SD video..

Nexy
Posts: 73
Joined: Sun Oct 09, 2011 9:03 pm

Re: Raspberry Pi Video Encoding...

Fri Nov 25, 2011 8:56 pm

@vman81: Somewhat off-topic:
While expensive, some people had good results using Amazon S3 and EC2. I\'ve not looked into it at any real detail for a couple of years but by the looks of it, it\'s only gotten cheaper, especially with EC2 Spot Instances and S3 Reduced Redundancy. Both of which wouldn\'t be a problem for your application.

The GPU Quadruple Extra Large should slice through the task like a hot knife through butter although this post suggests non-GPU to be better.

You\'d wanna get your filesizes right down though, as EC2/S3 bills you transfer *out*, at $0.12 per gig that\'ll mount up at $120 per TB. If you see 50% output, that\'d be
EC2 (or S3) traffic out = 1.75TB x $0.12 = $210
+ EC2 processing + maybe some S3 storage to make life easier.

There do seem to be some ready-rolled solutions for cloud transcoding, ankoder offer an interesting (if expensive looking) solution, zencoder also have an interesting service. It may also be worth looking at Rackspace or one of the other cloud processing people. The sums are rough but if it\'s a task you\'re looking to offload to something/somewhere other than your server, it may be worth a look. It may work out cheaper than building a conventional x64 rig and powering it. (Although $210+ ain\'t pocket change!)

Edit: Changed to the right URL tags, I\'m not on Reddit!

bradburts
Posts: 341
Joined: Sun Oct 02, 2011 7:07 am

Re: Raspberry Pi Video Encoding...

Fri Nov 25, 2011 10:43 pm

[quote]Quote from liz on November 25, 2011, 00:37
Fraid not - we don\'t have ffmpeg integration. We\'ll start bringing stuff like that online when we have cameras next year, but it\'s not going to be in the first firmware drop. (So yes, the board has the guts, but we\'re not providing the software to let you do that out of the box - it\'s not a first-tier requirement for the device.)[/quote]
liz, r u saying that the RPI will transcode to H264 in real-time or that the GPU support transcode offline with software in the future?
RT would be neat.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5202
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Raspberry Pi Video Encoding...

Fri Nov 25, 2011 10:54 pm

RT - keep your fingers crossed that we can implement it smoothly!
Director of Communications, Raspberry Pi

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23874
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi Video Encoding...

Sat Nov 26, 2011 11:04 am

The GPU can encode 1080p30 to H264 (at about 25Mb/s). It\'s just that the code to link that to the Arm/Linux isn\'t ready. At the moment it\'s all camera encoding, so no need to move data to and from the Arm - it just streams in from the camera.

It cannot encode/decode at that speed at the same time (transcode).

It may be able to transcode SDp30, it\'s all down to bitrate.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

nichobb
Posts: 82
Joined: Sat Nov 19, 2011 10:34 am

Re: Raspberry Pi Video Encoding...

Sun Nov 27, 2011 11:43 am

Hi,
I\'m reading the first response from Liz as saying the first r-pi model won\'t be able to convert files (eg from mkv to avi not talking about watching at same time), even with existing software just using the cpu. Is this the case or have I misunderstood? Is it just that the process would be painfully slow (converting at 6 fps would be fine for my use to get setup on and upgrade to future camera model as advised).

My question is probably just confusion over terminology. I understand the GPU and firmware isn\'t set up to transcode yet and future boards may do so (if all goes to plan) which may or may not be hacked into previous versions (wouldn\'t count on it). All not an issue other than to say that it\'s impressive giving current pricing - indeed even if it was an issue so what. :)

Thanks for any clarification.

kiaas
Posts: 18
Joined: Mon Nov 21, 2011 12:03 pm

Re: Raspberry Pi Video Encoding...

Sun Nov 27, 2011 1:15 pm

[quote]Quote from nichobb on November 27, 2011, 11:43
Hi,
I\'m reading the first response from Liz as saying the first r-pi model won\'t be able to convert files (eg from mkv to avi not talking about watching at same time), even with existing software just using the cpu. Is this the case or have I misunderstood? Is it just that the process would be painfully slow (converting at 6 fps would be fine for my use to get setup on and upgrade to future camera model as advised).

My question is probably just confusion over terminology. I understand the GPU and firmware isn\'t set up to transcode yet and future boards may do so (if all goes to plan) which may or may not be hacked into previous versions (wouldn\'t count on it). All not an issue other than to say that it\'s impressive giving current pricing - indeed even if it was an issue so what. :)

Thanks for any clarification.[/quote]
If you can run any software you want on it that\'ll compile to ARMv6 (you can) you can transcode media. slowly.

nichobb
Posts: 82
Joined: Sat Nov 19, 2011 10:34 am

Re: Raspberry Pi Video Encoding...

Sun Nov 27, 2011 3:50 pm

cheers that makes sense.

USvER
Posts: 21
Joined: Sun Aug 14, 2011 6:45 pm

Re: Raspberry Pi Video Encoding...

Sat Dec 03, 2011 12:14 pm

Yes!!! Finaly i got some peace of mind about H264 encoding!!!

Is there DMA?
And wuld be this \"link\" open-sourced?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23874
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi Video Encoding...

Sat Dec 03, 2011 1:37 pm

What do you mean by \'Is there DMA?\'

The GPU does H264 1080p30 encoding. It can also decode the same, it cannot do both at the same time. Once software is ready you will be able to use the GPU encoding from Linux libraries. At this stage some of those libraries may not be open source, but you will still be able to encode/decode as you wish.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

relaxed
Posts: 2
Joined: Mon Nov 28, 2011 11:30 am

Re: Raspberry Pi Video Encoding...

Sat Dec 03, 2011 1:46 pm

I think some of you are confused.

1) FFmpeg should compile and work on the Pi from day one. It will not use the GPU for hardware encoding and I doubt it ever will. Which means it will be slow.

2) I would guess the hardware encoding will only work with the camera and use baseline or main profile to achieve 1080p30. I also assume it will be variable frame rate and not that great. Still cool from something the size of a credit card.

tl;dr The Pi will not be an encoding workhorse.

The real question is- what software will we use to decode 1080p h264? As I understand it mplayer will not be able to take advantage of hardware decoding. What will be used? What are the hardware decoding restrictions, if any?

USvER
Posts: 21
Joined: Sun Aug 14, 2011 6:45 pm

Re: Raspberry Pi Video Encoding...

Sat Dec 03, 2011 2:01 pm

Thank you... All questions are gone! Can\'t wait to play with this :D

Thorbjoern
Posts: 3
Joined: Tue Oct 18, 2011 11:07 am

Re: Raspberry Pi Video Encoding...

Fri Dec 16, 2011 5:18 pm

[quote]Quote from jamesh on November 26, 2011, 11:04
The GPU can encode 1080p30 to H264 (at about 25Mb/s). It\'s just that the code to link that to the Arm/Linux isn\'t ready. At the moment it\'s all camera encoding, so no need to move data to and from the Arm - it just streams in from the camera.

It cannot encode/decode at that speed at the same time (transcode).

It may be able to transcode SDp30, it\'s all down to bitrate.[/quote]

It would be great to be able to use it as a cheap transcoder. I record quite a bit of material in MPEG2 and MPEG4 - a simple post processing step would be really nice especially at that speed.

User avatar
Jessie
Posts: 1754
Joined: Fri Nov 04, 2011 7:40 pm
Location: C/S CO USA

Re: Raspberry Pi Video Encoding...

Fri Dec 16, 2011 5:48 pm

[quote]Quote from relaxed on December 3, 2011, 13:46
I think some of you are confused.

1) FFmpeg should compile and work on the Pi from day one. It will not use the GPU for hardware encoding and I doubt it ever will. Which means it will be slow.

2) I would guess the hardware encoding will only work with the camera and use baseline or main profile to achieve 1080p30. I also assume it will be variable frame rate and not that great. Still cool from something the size of a credit card.

tl;dr The Pi will not be an encoding workhorse.

The real question is- what software will we use to decode 1080p h264? As I understand it mplayer will not be able to take advantage of hardware decoding. What will be used? What are the hardware decoding restrictions, if any?[/quote]

@relaxed: some of them are confused, unfortunatly, you are as well. The R-Pi will have encode and decode of 1080p H.264 content as soon as the driver is avalible for Linux. The driver will not be immedeatly avalible at launch. It just won\'t be able to do both at the same time which is required to transcode. It is generally a good idea to pay close attention to posts made by anyone with the Administrator tag because most of them work (or have worked) at Broadcom and had a hand in the design of the specific SOC being used here, are working on the drivers personally, or are very close to these people.

The hardware is more than capable. It will just be a matter of waiting on the driver.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23874
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi Video Encoding...

Fri Dec 16, 2011 5:54 pm

[quote]Quote from relaxed on December 3, 2011, 13:46
I think some of you are confused.

1) FFmpeg should compile and work on the Pi from day one. It will not use the GPU for hardware encoding and I doubt it ever will. Which means it will be slow.

2) I would guess the hardware encoding will only work with the camera and use baseline or main profile to achieve 1080p30. I also assume it will be variable frame rate and not that great. Still cool from something the size of a credit card.

tl;dr The Pi will not be an encoding workhorse.

The real question is- what software will we use to decode 1080p h264? As I understand it mplayer will not be able to take advantage of hardware decoding. What will be used? What are the hardware decoding restrictions, if any?[/quote]

Hmm. not the only confused ones it seems.

1080p30 high profile is possible and the quality is very good. At the moment it will only work from the camera input. I think it supports both fixed and variable frame rate. I\'ll try and take a video with the chip here and post it somewhere for people to see the quality. Don\'t hold your breath, I\'m pretty busy.

At first launch we will provide an in house media player. In the long run I believe gstreamer HW support is being thought about. The chip can play quite a variety of formats, but what you get will depend on licencing.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23874
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi Video Encoding...

Fri Dec 16, 2011 5:56 pm

Crossed post there with Jessie, only thing to ad is that the SoC could probably transcode 720p30 in real time. 1080p30 transcode is not possible - just not enough horsepower. Certainly good enough for SD transcode at p30.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

WereCatf
Posts: 89
Joined: Thu Jan 26, 2012 7:16 am
Contact: Website

Re: Raspberry Pi Video Encoding...

Thu Jan 26, 2012 7:32 am

Is the situation still the same, ie. no support for H/W encoding until after launch? I was hoping to use GStreamer for a project of mine as GStreamer already sports OpenMAX plugin for decoding, but I would also be delighted if I could use GStreamer for encoding, too. It doesn't need to be realtime encoding as it won't be for streaming purposes, the point is that being able to use H/W for it would still be faster than using what I have available currently.

Also, do you guys have specifications available yet as to exactly what codecs the hardware can do in H/W and the codec restrictions (resolution, bit depth, bitrate etc.) and what subset of those will be available to end-users? I am obviously hoping to be able to do H/W assisted encoding of all the codecs the hardware supports, but I am not clear on the licensing issues.

WereCatf
Posts: 89
Joined: Thu Jan 26, 2012 7:16 am
Contact: Website

Re: Raspberry Pi Video Encoding...

Sun Jan 29, 2012 11:25 am

I'm bumping this thread this once in the hopes someone would have something new to say about the matter.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23874
Joined: Sat Jul 30, 2011 7:41 pm

Re: Raspberry Pi Video Encoding...

Sun Jan 29, 2012 11:38 am

H264 and MP4 will be there. 1080p30 High profile, should do up to about 50Mbits/s decode, think encode as well, if the SD card can keep up.

I think there is still quite a bit of software work to do for encode as encoding from the host isn't a usual use case for the SoC - usually just encodes direct form the camera. Not sure of current progress. Need to talk to the middleware team at work to see what's going on.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

WereCatf
Posts: 89
Joined: Thu Jan 26, 2012 7:16 am
Contact: Website

Re: Raspberry Pi Video Encoding...

Sun Jan 29, 2012 11:56 am

JamesH said:


H264 and MP4 will be there.


MP4 is not a codec, it's a container. And yes, H.264 encoding has been mentioned several times, but what about XviD? Or WMV9? VP8/WebM (I have not seen even decoding mentioned anywhere)


I think there is still quite a bit of software work to do for encode as encoding from the host isn't a usual use case for the SoC - usually just encodes direct form the camera. Not sure of current progress. Need to talk to the middleware team at work to see what's going on.


H/W assisted encoding is actually one of those things RPi would be excellent for and that's why I am really hoping that its encoding capabilities will be fully exposed to userland. I am working on a transcoding client and server framework, there are two preliminary work-in-progress screenshots on my G+ page, and RPi would make a delightful transcoding server if all its encoding capabilities were fully useable.

Return to “General discussion”