regularfriend
Posts: 5
Joined: Tue Dec 18, 2018 7:57 pm

Composite AV recorder / Passthrough

Tue Dec 18, 2018 8:04 pm

Hey I'm new to using raspberry PIs (i made a htpc with one years ago and have done nothing with the pi since), but i have a project that i think this system would be perfect for.

Basically I want to take a component (old i know will mostly be used for recording the nintendo wii) input, record the video and audio data, preferably compress it but if not not a huge deal resolution will be 480i or 480p so the files wont be super huge regardless, and then pass through /output the data without any lag to a TV

I believe the best way to do this is to internally split the video somehow (kinda like a powered distribution amplifier) and immediately pass through the raw video and then record the split video separately to avoid adding a delay/lag in the output.

If not possible to have the lagless passthrough i can concede that and just split the signal outside of the pi and essentially have this work just as a small av recorder.

Do you all have any recommendations on what i should start looking into to build this? Haven't seen similar projects on the forum. I'm an experienced programmer so im not too worried about handling the software side of this (recording and compressing the data), but i am not very experienced with the hardware and am not sure how i would get/split the data on that end.

fruitoftheloom
Posts: 25282
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 7:13 am

regularfriend wrote:
Tue Dec 18, 2018 8:04 pm
Hey I'm new to using raspberry PIs (i made a htpc with one years ago and have done nothing with the pi since), but i have a project that i think this system would be perfect for.

Basically I want to take a component (old i know will mostly be used for recording the nintendo wii) input, record the video and audio data, preferably compress it but if not not a huge deal resolution will be 480i or 480p so the files wont be super huge regardless, and then pass through /output the data without any lag to a TV

I believe the best way to do this is to internally split the video somehow (kinda like a powered distribution amplifier) and immediately pass through the raw video and then record the split video separately to avoid adding a delay/lag in the output.

If not possible to have the lagless passthrough i can concede that and just split the signal outside of the pi and essentially have this work just as a small av recorder.

Do you all have any recommendations on what i should start looking into to build this? Haven't seen similar projects on the forum. I'm an experienced programmer so im not too worried about handling the software side of this (recording and compressing the data), but i am not very experienced with the hardware and am not sure how i would get/split the data on that end.

The Raspberry Pi has no suitable AV inputs without extra hardware.

You could try using a Stk1160 based USB 2.0 video and audio capture device:

https://linuxtv.org/wiki/index.php/Easycap

https://www.linuxtv.org/wiki/index.php/ ... re_devices
The information is out there....you just have to let it in.

My other Linux machine is a ChromeBox

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 10300
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 11:42 am

Zero lag is impossible through any digital system. Everything will generally add 2-3 frames worth of delay (assume 20ms/frame for 50Hz refresh rates).
Search for "component video distribution amplifier" and you'll get a bundle of hits via the normal retailers.

USB A/V capture cards on the Pi have variable results. As noted in fotl's link, Easycap is a name that is used for a variety of different hardware.
The ADV728x-MA range of chips from Analog Devices that work very well capturing video via the camera connector on the Pi. They'll do composite, s-video, and component video happily. You'll need something else to handle the audio (either USB or I2S). I'd recommend the ADV7280MA or ADV7282MA as they include a deinterlacer.
The downside is that there aren't any commercially available boards that I'm aware of. I know of a couple of people who have built their own boards, and I have a hacked up evaluation board for it.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

regularfriend
Posts: 5
Joined: Tue Dec 18, 2018 7:57 pm

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 2:31 pm

Thanks for the info!

gonna look into using the ADV7282MA or something similar to record video. Audio is an afterthought and not very important to my use case so I'll worry about that later.

A lot of capture cards n the likes have lagless passthrough which makes me feel like it should be something i should hack together. I guess my current plan is to try and build as small of a distribution amp as possible and cram it into the same case as the pi and then send one out to the pi and one out to the 'passthrough' sounds kinda jank, might not be feasible but im going to start looking into it.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 10300
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 3:28 pm

regularfriend wrote:
Wed Dec 19, 2018 2:31 pm
Thanks for the info!

gonna look into using the ADV7282MA or something similar to record video. Audio is an afterthought and not very important to my use case so I'll worry about that later.

A lot of capture cards n the likes have lagless passthrough which makes me feel like it should be something i should hack together. I guess my current plan is to try and build as small of a distribution amp as possible and cram it into the same case as the pi and then send one out to the pi and one out to the 'passthrough' sounds kinda jank, might not be feasible but im going to start looking into it.
If you're building your own board then you could be a little clever and omit the 75ohm terminating resistors from the ADV7282 and rely on the 75ohm termination of the passed through device. You can get phonos with "break" contacts (eg https://www.chk-electronics.com/RC-1190.html) so that you add the termination should nothing be plugged into the pass through connectors.
The slight gotcha is that the ADV reference design uses the 75ohm termination as a x0.68 attenuator, so you'd need to rework that. It'd almost be easier to add the necessary op-amp circuit to drive the outputs, although you may end up needing +/- supply rails just for that, which would be a waste.

(Looking at the prices of the chips on RS, the 7280-M is half the price of the 7282-M for some non-obvious reason.)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

noggin
Posts: 106
Joined: Sun Feb 21, 2016 1:55 pm

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 5:10 pm

Also - if capturing via USB and also recording to disc - you will almost certainly want compression either in the capture card or at least the recording subsystem.

Assuming 720x576 at 25fps capture in 4:2:2 8-bit you will have an uncompressed bitrate of 720x576x25x16 = 166Mb/s

If you capture AND record this you are sending that data over the single USB bus in the Pi twice - which would be 330Mb/s (or ~40MB/s). That's a lot of data to move without losing any on a USB 2.0 bus.

Is the lag issue a passthrough-only limit or do you need the Pi captured video to be as low-lag as possible too? If the former then you could use any number of USB H.264 or MPEG2 capture devices with passthrough (or just split the component video before feeding the capture card) Hauppauge have a couple of Component-friendly gaming capture cards - though the Linux driver support is a bit patchy.

drgeoff
Posts: 11385
Joined: Wed Jan 25, 2012 6:39 pm

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 5:31 pm

@regularfriend

The first thing you need to do is learn the difference between composite and component.
Quis custodiet ipsos custodes?

regularfriend
Posts: 5
Joined: Tue Dec 18, 2018 7:57 pm

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 6:23 pm

If you're building your own board then you could be a little clever and omit the 75ohm terminating resistors from the ADV7282 and rely on the 75ohm termination of the passed through device.
ohhh this is not a bad idea def gonna try this.

thanks for all the help. i feel like im at a good place to start off. may or may not post problems i encounter as i go forward and will def post the finished build when its done.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 10300
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 6:53 pm

drgeoff wrote:
Wed Dec 19, 2018 5:31 pm
@regularfriend

The first thing you need to do is learn the difference between composite and component.
Possibly, but the Wii supports both so in some ways it doesn't really matter. The adv chip does likewise.
Component will give you better quality as you haven't stuffed the chroma signals onto the same cable as the luma.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

regularfriend
Posts: 5
Joined: Tue Dec 18, 2018 7:57 pm

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 8:16 pm

drgeoff wrote:
Wed Dec 19, 2018 5:31 pm
@regularfriend

The first thing you need to do is learn the difference between composite and component.
I do know the difference and use composite on my wii

regularfriend
Posts: 5
Joined: Tue Dec 18, 2018 7:57 pm

Re: Composite AV recorder / Passthrough

Wed Dec 19, 2018 8:18 pm

and to be quite honest on the splitter/distribution amp side what i do will support both. Since its just splitting and amplifying a signal i could just plug in the single composite video cable in one of the inputs and it should be just fine have done this on many distribution amplifiers in the past no problem .

Return to “Graphics, sound and multimedia”