CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Trying to make a device that plays video

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
etalha



Joined: 10 May 2020
Posts: 2

View user's profile Send private message AIM Address

Trying to make a device that plays video
PostPosted: Mon Jun 01, 2020 3:56 am     Reply with quote

Hello,
I am trying to make a device that plays video (like a stream but from an sd card) or shows a picture on the touch screen. Can anybody give any advice? I want to use ccs c compiler and a pic microcontroller since I am quite used to them.
Best regards
Ttelmah



Joined: 11 Mar 2010
Posts: 19260

View user's profile Send private message

PostPosted: Mon Jun 01, 2020 9:52 am     Reply with quote

I have to say, honestly, not a good choice.
To actually 'play' video, requires the processor to perform decoding of
the data stream, and then output this to some form of video output.
The PIC is very difficult to make do jobs like this, since it lacks the ability
to have a memory mapped video buffer, which is really required to
do the output efficiently. Also, because the PIC is not suited to this
sort of task, few (no...) codecs are available prewritten for the PIC.
You could do this possibly 1000* easier with a device like the Pi,
for which codecs already exist to do the decoding, and supports video
output.
To do this on a PIC, is probably a minimum of about 6 months of
continuous coding, and would only be remotely possible on the fastest
PIC23/33 chips, and would not be a 'good' solution at the end...
temtronic



Joined: 01 Jul 2010
Posts: 9134
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jun 01, 2020 10:10 am     Reply with quote

Hmm 'video'....well it all depends on the 'specs'.....
Something lowres, black and white aka 'security camera' is fairly easy, and basic PICs can generate the required VGA data to send to a CRT or monitor.
It gets a LOT easier if you use an pre-made 'VGA module'.
Anything more, then you'll need a 'VGA module' and see if the specs of it are compatible with the 'video' you want to see.
Mr T is right it will take a LOT of time, but playing with PICs is fun !

Jay
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Jun 01, 2020 11:47 am     Reply with quote

I'm with Ttelmah on this one,

If you're talking about reading an SD card and decoding something like an MP4/AVI/MKV, that's a LOT of specialized math just to generate the frames.

There's a series of PIC24s that drive displays, but even then I don't think they have the math functions or bus speed to read off something like SPI at a rate fast enough to decode a modern video file.

And do you want audio with that?? Ouch.

There are CPUs really geared for this. the Pi is a good place to look... some of the other ARM based CPUs that have build in video generation, high-speed serial controllers specifically to work with SD cards at full speed and so on.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah



Joined: 11 Mar 2010
Posts: 19260

View user's profile Send private message

PostPosted: Tue Jun 02, 2020 12:51 am     Reply with quote

It really is a case of 'right tool for the job'.....

For a job wanting a low power CPU to do basic I/O tasks, the PIC is
brilliant. Include timing, ADC'c, and sequencing, equally good. But the maths
for video decoding, it is less suited for, and for video output very poorly
suited (though bkamen mentions PIC24's that drive displays, these are
for built in LCD controllers, not video output).
Jay is right, low resolution may well be 'possible', but honestly for anything
above this, 'think again'....
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Jun 02, 2020 1:15 am     Reply with quote

Ttelmah wrote:
It really is a case of 'right tool for the job'.....

(though bkamen mentions PIC24's that drive displays, these are
for built in LCD controllers, not video output).


The PIC24 I'm thinking about can *be* an LCD controller (color too).
But there's no other peripheral to move the video stream into the frame buffer fast enough for anything... let alone also decoding MPEGs or whathaveyou.

I could see a nice B&W or color thermostat or some other smart home device with a touch screen with cute icons and all... but not video.

The instruction set isn't there.
The clock speeds aren't there.
The I/O to storage media isn't really there.

Yea... ARM32 with an RTOS or Linux with a rippin SDcard controller (4bit I/O @ 52MHz) with the cpu oomph to move that memory, process the data stream and work it into a video buffer......

I love PICs, but this is not what they're made for.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
temtronic



Joined: 01 Jul 2010
Posts: 9134
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jun 02, 2020 4:58 am     Reply with quote

re:
Quote:
It really is a case of 'right tool for the job'

PICs are the right tools, the jobs are the wrong ones....

Still, it reminds me of using 8 bit ISA HD controller cards to get a 'powerhouse PIC', the 16F877, to have a 10MB harddrive for data storage. No such thing as flash drives or SD cards back then !!

'Video' requires a HUGE amount of data AND speed,something PICs generally don't have.
Ttelmah



Joined: 11 Mar 2010
Posts: 19260

View user's profile Send private message

PostPosted: Tue Jun 02, 2020 6:14 am     Reply with quote

Yes.
I have to say, I'm currently developing an instrument, that draws a
coloured graph that animates every second onto a touch screen.
You have hidden buttons to display status, and access menus, and
a touch cursor to give the value at a point back in time.
On a PIC33EP512GM304, at 120MHz, and it runs very well (just tweaking
the final 'history' storage). But even at that speed there are momentary
delays when you touch a button, before the whole screen is redrawn....
Only perhaps a 1/4 second, but it shows just how much data has to move
to draw something that large (800*480*24bit).
temtronic



Joined: 01 Jul 2010
Posts: 9134
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jun 02, 2020 6:32 am     Reply with quote

yeesh ! a quarter second is a 'lifetime of waiting', and that's running a very powerful PIC at 120 MHz with Mr. T's optimised code...

Hmm, makes me wonder if it's possible to 'overclock' PICs and if so how reliable they are ? I know older PCs could be overclocked, until you got into memory access issues and they'd lockup....
Ttelmah



Joined: 11 Mar 2010
Posts: 19260

View user's profile Send private message

PostPosted: Tue Jun 02, 2020 11:41 pm     Reply with quote

In this case it is because of the time needed to actually 'draw' the LCD
data. Even with DMA, a lot of work...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group