Raspberry Pi and MPEG2, H264

Digital ATV - The latest generation, cutting edge ATV - Please discuss it all here.
Forum rules
This forum is run by the BATC (British Amateur Television Club), it is service made freely available to all interested parties, please do not abuse this privilege.

Thank you
Post Reply
g4bbh
Posts: 74
Joined: Thu Mar 13, 2008 7:19 pm

Raspberry Pi and MPEG2, H264

Post by g4bbh » Fri Aug 24, 2012 4:45 pm

The Raspberry Pi Foundadtion have just announced that a licence for MPEG2 decode is available (cheaply - GBP2.40) and that the Raspberry Pi which already has H.264 Decode will shortly have H.264 encode in its firmware. This suggests that this little computer will soon see applications in DATV.
See http://www.raspberrypi.org/archives/1839
Dick G4BBH

G4GUO
Posts: 729
Joined: Tue Feb 16, 2010 12:51 pm

Re: Raspberry Pi and MPEG2, H264

Post by G4GUO » Fri Aug 24, 2012 5:08 pm

Now we just need MPEG2 encode and their nice little ccd camera add on.
Either that or we all transition to MPEG4.

- Charles

g4bbh
Posts: 74
Joined: Thu Mar 13, 2008 7:19 pm

Re: Raspberry Pi and MPEG2, H264

Post by g4bbh » Fri Aug 24, 2012 8:21 pm

G4GUO wrote:Now we just need MPEG2 encode and their nice little ccd camera add on.
Either that or we all transition to MPEG4.

- Charles
Unfortunately there is probably only hardware decode built in. It would be a whole new ball game if MPEG-2 hardware encode was built in. It sounds as if H.264 hardware encode and decode are there though.

Dick G4BBH

G4GUO
Posts: 729
Joined: Tue Feb 16, 2010 12:51 pm

Re: Raspberry Pi and MPEG2, H264

Post by G4GUO » Sat Aug 25, 2012 6:18 am

Unfortunately there is little information on the Broadcom site about the Videocore IV graphics co-processor
(the one used in the BCM2835) other than it supports 1080p30 Full HD HP H.264 Video Encode/Decode
so MPEG2 decoding came as a bit of a surprise to me.

I shall wait to see what library support there is going to be for it before I get too enthusiastic as Broadcom
are not the most open of companies. I did find a group of people that are working on reverse engineering the
Videocore IV instruction set (I wish them luck).

g4bbh
Posts: 74
Joined: Thu Mar 13, 2008 7:19 pm

Re: Raspberry Pi and MPEG2, H264

Post by g4bbh » Sat Aug 25, 2012 10:41 am

Dom, who knowsw about these things said about MPEG-2 encoding:-

"Not possible I'm afraid. The only encode the hardware supports is H.264 and MPEG4.
And only the H.264 is enabled."

I guess this means that MPEG-4 encoding could be enabled in the future but MPEG-2 encoding is out.

Dick

G4GUO
Posts: 729
Joined: Tue Feb 16, 2010 12:51 pm

Re: Raspberry Pi and MPEG2, H264

Post by G4GUO » Sat Aug 25, 2012 10:53 am

Yes that was a reply to my question (under a different name).

I have never managed to figure out the difference between MPEG4 and H.264
they seem to be used interchangeably.

With my HD experiments I use a Hauppague PVR-HD which supports H.264 1080i
and I can get that to decode correctly my HD DVB-T transmissions on my standard
HD DVB-T TV.

- Charles

markaren1
Posts: 59
Joined: Sat Sep 10, 2011 8:49 pm

Re: Raspberry Pi and MPEG2, H264

Post by markaren1 » Sun Aug 26, 2012 1:03 am

I think I saw somewhere that MPEG4 decoders require to be (or implicitly are) backwards compatible with MPEG2.

...or it could have just been a dream.

-Mark

G4GUO
Posts: 729
Joined: Tue Feb 16, 2010 12:51 pm

Re: Raspberry Pi and MPEG2, H264

Post by G4GUO » Sun Aug 26, 2012 6:12 am

There seems to be some confusion over this.

Doing a Google search I found that MPEG4 part 10 is the same as H.264
However somewhere else I found it stated that H.264 is a better compression
algorithm than MPEG4. I guess that is what happens when you have multiple
organisations developing standards (MPEG and ITU).

A further search seems to show that MPEG4 contains two video coding parts.
part 2 ASP (Advanced Simple Profile) and part 10 AVC (Advanced Video Coding aka H.264).

- Charles

G4GUO
Posts: 729
Joined: Tue Feb 16, 2010 12:51 pm

Re: Raspberry Pi and MPEG2, H264

Post by G4GUO » Fri Sep 13, 2013 2:12 pm

I have had a chance to do some work on the Raspberry PI video now. There is an application
called Raspivid that allows you to output the encoded video either to a file or stdout.

The MMAL API (the bit you talk to get to the GPU via), supports h.263 and h.264
video encoding and MPEG2 video decoding (if you buy a license). Audio encoding is
not supported because the licences were very expensive compared to the video encoding
ones (I got an answer from the PI people over that one.). So audio encoding would have to
be done using the ARM and either ffmpeg or its derivative.

The good news is that the MPEG4 encoder seems to be able to go down to very low coding
rates. I have had it encoding at 64 kbits (very blocky though).

It would also be possible to use a PI to transcode between MPEG2 and MPEG4, 2 in 4 out.

One idea I had was that a PVRUSB2 could be used to capture the video and audio, send it to
the PI over USB, the PI could transcode the MPEG2 video into MPEG4, and pass the audio
straight through. That would get over the problem of the non hardware audio encoding and
the fact there is no composite video input support. The PI will support a PVRUSB2 with the
addition of the correct firmware file to /lib/firmware

- Charles

Post Reply

Return to “DATV - Digital ATV”