How to make your own linux small board which does digital video - Page 1
Forum section: electronics / projects

author: VEGETA
author_rank: Super Contributor
timestamp: October 23, 2022, 08:32:32 pm
content: HelloI have a long term project in mind (aside from my other currently achievable ones) which is to have analog video (rgb with csync, rgb vga, component, s-video, cvbs, etc...) input to a board (the project) which takes it and scale\deinterlace\interlace\etc... it then spits it out to hdmi or similar... in real time or as low latency as possible (< 1 frame of video).System design idea:Analog video -> video digitizer IC (ADV7181C\ISL51002\ADV7186\AD9984A) -> SoC chip which takes parallel digital video bits then use mpv to scale it -> HDMI + DAC outputs.my idea is to have a linux board which takes 24-bit or 30-bit of parallel RGB digital video then use MPV player (the best) to scale\deinterlace\interlace\etc... then deliver them to output port which is mostly hdmi. can be hdmi within the SoC or the output can be also a 24 or 30 bits of parallel digital video which I can take it into a hdmi transmitter for example.such video scaler products exist but they use fpga to do the scaling which i cannot achieve, it is very hard for me. thus thought of this route since mpv or similar player or even vapoursynth can do it fast enough i think.I have seen this:https://wiki.pine64.org/wiki/Quartz64but alsoRK3568which seems to have 24-bit digital outputs (to be used with DAC) as well as HDMI output.so what do you think?i prefer a chip which i can get from digikey\mouser or at least get it easily without dealing with licensing and so on. RK3568 seems ok but don't know how and where to buy it plus the price.Of course, I don't want to do some complicated software. I prefer doing PCB design and layout, have maybe sd card or similar option to load linux image, and the soc should work fine.for your kind help and suggestions.

author: VEGETA
author_rank: Super Contributor
timestamp: October 24, 2022, 08:27:20 am
content: I added some links and suggested chips + better formatting.

author: dzseki
author_rank: Frequent Contributor
timestamp: October 24, 2022, 08:42:01 am
content: Just curious why do you want to make your own? with the decline of analog video sources one can easily find video scalers on the market relatively easily in every flavour.Regardless, the application screams for an FPGA if latency is important, going the PC way will unacceptably increase the latency, at least if human interaction is needed or sound is also present.

author: rob77
author_rank: Super Contributor
timestamp: October 24, 2022, 08:56:10 am
content: how exactly do you want to achieve a <1 frame latency when you have a operating system and a vide player in the chain ?btw there are single chips doing the job for example:http://www.mitinc.co.kr/pdf/MDIN380_Brochure_10Feb2017.pdfthat's just and example, you can find a different one which fits your requirements exactly.

author: VEGETA
author_rank: Super Contributor
timestamp: October 24, 2022, 09:36:05 am
content: My application is to build a retro gaming consoles scaler, these require special care for their signals and some custom settings. there are scalers available but all fpga and I cannot do fpga and won't be able to do it to this level.I thought 1 frame latency is also achievable if we have good enough processor. I mean, when we play video games and video files the latency is 0, and with very minimal processing of the input signal i thought it can achieve such low latency.MDIN and similar are not customizable as much as full fpga design, especially if i want to make crt scanline effects and so on. plus they refused to give me any documentation unless i buy +2100 ICs due to their new policies. ASIC design is good but not for this application as it requires customization.

author: eutectique
author_rank: Frequent Contributor
timestamp: October 24, 2022, 01:41:54 pm
content: Quote from: VEGETA on October 24, 2022, 09:36:05 amIn case of real-time transcoder, the latency is the delay between visible input stream and visible output stream.In case of file playback, what is the visible input stream?

author: VEGETA
author_rank: Super Contributor
timestamp: October 24, 2022, 02:47:14 pm
content: Quote from: eutectique on October 24, 2022, 01:41:54 pmfrom analog video to digitizer chip and converted to digital bits is instantaneous, zero lag is there. consider this as input.now i am not really knowledgeable about latency afterwards... therefore this thread is to discus and learn. what do you think?my idea was that if digital video is there then using some broadcast or playback software or anything like mpv could work... since mpv itself is crazy fast. and when you deliver the output digital bits to hdmi tx or video dac, it will also be zero lag.so it is all about internal processing of mpv and the os... therefore this thread.i am open to learning

author: rob77
author_rank: Super Contributor
timestamp: October 24, 2022, 03:03:56 pm
content: Quote from: VEGETA on October 24, 2022, 09:36:05 amwhat's the reason behind not using a fpga ?

author: eutectique
author_rank: Frequent Contributor
timestamp: October 24, 2022, 03:14:10 pm
content: Quote from: VEGETA on October 24, 2022, 02:47:14 pmIn my understanding, file playback usesa fileas an input stream, not an analog or any other video format.

author: VEGETA
author_rank: Super Contributor
timestamp: October 24, 2022, 06:32:25 pm
content: Quote from: rob77 on October 24, 2022, 03:03:56 pmreason is it being so hard on me at this level. products doing this on fpga exist but it is so complicated and uses vendor IPs for doing scaling and so on. it gets more complicated if custom features and effects are to be added. simply impossible for me. I am very bad at code and I know myself that I won't be able to reach such levels.Quotempv and vlc or similar players can also use other sources i think. the idea is to get the analog video to be digitized and fed into the SoC, then it becomes accessible to such players.Similar idea is done here, please check:https://stardot.org.uk/forums/viewtopic.php?f=3&t=14430

author: rob77
author_rank: Super Contributor
timestamp: October 24, 2022, 06:51:03 pm
content: Quote from: VEGETA on October 24, 2022, 06:32:25 pmif FPGA is hard for you then the whole project is pointless... doing it in FPGA is far easier than designing and building a whole linux computer - be it based on any SoC.how do you plan to interface the ADCs ? you need a high speed interface for that, and there is no 24bit parallel port running at 80MHz on a SoC with linux drivers on OS sidesure many SoCs have the needed amount of gpios but you need to write a device driver to handle it. and you will need documentation and sdk from the SoC manufacturer...have you ever developed a embeded system ? you can't install ubuntu there.. it doesn't work that way. either you use a ready SBC board which doesn't have the needed interface for the ADC but has an opereating systrem available, or you build your own with your own HW interface layout but you have to build your own OS image as well.so FPGA is the way to go, buy a FPGA development board with HDMI port and enough IO pins and start playing

author: VEGETA
author_rank: Super Contributor
timestamp: October 24, 2022, 07:08:52 pm
content: Quote from: rob77 on October 24, 2022, 06:51:03 pmwell, in Jordan, Xilinx does not offer support so Intel is the way to go. the lite version of quartus software can do cyclone v and 10 LP which may not be able to reach 4k60p output video after scaling...anyway, such fpga based products exist, one of the best being retrotink 5x pro and it already has so many features. can't really beat it up at my skill level and the idea of doing hardware code to achieve such features is hard for me...I don't know if it uses the intel scaler ip or not, some other unreleased products are using intel ip... but some others use their own. extremely hard work for someone like me which is why i thought of this route.

author: nctnico
author_rank: Super Contributor
timestamp: October 24, 2022, 08:53:17 pm
content: Just use a readily made board with a dedicated chip. There are so many available on Ebay/Aliexpress/Amazon. These will have low latency because more latency means needing more memory which is relatively expensive.If not, then going the FPGA route is the easiest way. Making a video scaler is pretty trivial anyway and doesn't need a complex FPGA at all. I have made video scalers using a simple CPLD with some SRAM attached to it.

author: VEGETA
author_rank: Super Contributor
timestamp: October 24, 2022, 09:15:57 pm
content: Quote from: nctnico on October 24, 2022, 08:53:17 pmoh so you worked on such projects... did you make a polyphase scaler which supports motion-adaptive deinterlacing? how about adding scan lines and CRT-like effects?assume doing my own linux board, can it achieve at most 1 frame of lag? what about using a ready board like pi4 or more powerful ones? I couldn't find one with video input interface, besides ones using MIPI inputI am interested in your scaler designing journey if you would like to explain more in details.

author: nctnico
author_rank: Super Contributor
timestamp: October 24, 2022, 09:22:12 pm
content: Where it comes to de-interlacing I just combine the two fields. Ask yourself: is a videogame going to produce an interlaced image? I'm pretty sure it won't. Also think about how you want resizing to be done. I doubt many CRT based games use a resolution that is greater than 640x480 so if you HDMI output has a 640x480 image, your monitor will do the scaling.

author: VEGETA
author_rank: Super Contributor
timestamp: October 24, 2022, 10:15:06 pm
content: Quote from: nctnico on October 24, 2022, 09:22:12 pmmost video signals I am interested in are 240p and 480i, with some at 480p. most of those are the retro consoles from PS2 era and backwards.the idea is to achieve 1080p scaling without resorting to tv scaler since these suck, or at least not optimal like custom ones.de-interlacing by bobbing is called line doubling but it produces flicker. combining fields from one frame to the next one (top1+bottom2...) is weave deinterlacing but it causes trouble with fast movement. motion-adaptive uses bobbing+weaving... weaves it most of the time and bobbing when fast motion.and how would you combine fields in verilog? use v_sync then do what @ its edge