Shop OBEX P1 Docs P2 Docs Learn Events
Need help on Propeller video project. — Parallax Forums

Need help on Propeller video project.

jknightandkarrjknightandkarr Posts: 234
edited 2015-04-13 16:07 in Propeller 1
I have no exp with the propeller's video function and require some help on a project. I need to try and recreate this
Trajectory_Guide_in_action.jpg

It's the KITT's Trajectory Guidance Screen for use with his Turbo Boost system. I wish to create this effect as close as possible to the show using the propeller's video function. I tried to find a video clip, but no luck. I was used in the ep Big Iron & Blind Spot. I would like to have the image of KITT slowly rise in angle, then when the desired angle is reached, hit a button n it launches like it did in the show. I figure if the button isn't pressed the angle can either start back at 0 and repeat or slowly drop back down to 0 then repeat. Any help would be appreciated. I will see about finding a decent video clip. I should be able to take a video with my camera while watching the show.

Joe
1024 x 819 - 136K

Comments

  • potatoheadpotatohead Posts: 10,261
    edited 2015-04-09 09:06
    Do you have a particular target display in mind?
  • Mike GreenMike Green Posts: 23,101
    edited 2015-04-09 09:22
    You're going to have to simplify the display in terms of detail because of the limited memory available (< 32K) for video buffering. Do you want to use a VGA monitor or an NTSC monitor? For a start, look at this (http://obex.parallax.com/object/260) graphics driver in the Propeller Object Exchange. There are several others that you could use as an alternative. The graphics driver I referenced works with either VGA or NTSC. Some of the others are VGA-only.

    Most of these drivers use a 4-color mode where each pixel can be one of 4 colors with black and white considered to be a color. Depending on the driver, each display line may have its own set of 4 colors chosen from a palette of up to 64.

    You can use a single display buffer or double buffers for smoother animation. In your case, very little would change from frame to frame (just the KITT image) so you might be able to get away with a single buffer and have more room for code.

    A video clip isn't the best way to go. It's a huge amount of data and the Propeller isn't particularly good at moving large amounts of data in and out quickly. The display you want has a lot of large areas with the same colors and those areas can be computed. The KITT image is the only thing that moves and that can be rotated and translated fairly easily from a simple small bitmap.

    If you want to use a special purpose LCD panel, consider one of the ones from 4D Systems. These have a built-in graphics controller that could simplify your task.
  • RaymanRayman Posts: 14,652
    edited 2015-04-09 09:43
    Yeah, the Propeller isn't particular well suited for images or video. You can display low quality images using a heroic effort over NTSC though:
    http://forums.parallax.com/showthread.php/113120

    Still, I think it'd be more rewarding to use something else for that job (maybe Raspberry or something).
  • jknightandkarrjknightandkarr Posts: 234
    edited 2015-04-09 11:10
    Rayman wrote: »
    Yeah, the Propeller isn't particular well suited for images or video. You can display low quality images using a heroic effort over NTSC though:
    http://forums.parallax.com/showthread.php/113120

    Still, I think it'd be more rewarding to use something else for that job (maybe Raspberry or something).
    Bad part is I only know the Propeller and BS2 series programing... I have an Arduino, but I haven't really done anything with it yet. I chose the Propeller because i know it. I figured that it could be somewhat made like the games that the Hydra book shows. I have started looking at my Hydra book, but so far, I am having a difficult time understanding what I am reading...
    Mike Green wrote: »
    You're going to have to simplify the display in terms of detail because of the limited memory available (< 32K) for video buffering. Do you want to use a VGA monitor or an NTSC monitor? For a start, look at this (http://obex.parallax.com/object/260) graphics driver in the Propeller Object Exchange. There are several others that you could use as an alternative. The graphics driver I referenced works with either VGA or NTSC. Some of the others are VGA-only.

    Most of these drivers use a 4-color mode where each pixel can be one of 4 colors with black and white considered to be a color. Depending on the driver, each display line may have its own set of 4 colors chosen from a palette of up to 64.

    You can use a single display buffer or double buffers for smoother animation. In your case, very little would change from frame to frame (just the KITT image) so you might be able to get away with a single buffer and have more room for code.

    A video clip isn't the best way to go. It's a huge amount of data and the Propeller isn't particularly good at moving large amounts of data in and out quickly. The display you want has a lot of large areas with the same colors and those areas can be computed. The KITT image is the only thing that moves and that can be rotated and translated fairly easily from a simple small bitmap.

    If you want to use a special purpose LCD panel, consider one of the ones from 4D Systems. These have a built-in graphics controller that could simplify your task.
    NTSC or PAL tv/monitor for those who are in the Knight Rider conversion community over seas. I want to add a touch more realizem to peoples conversions. There is a guy who has made a dvd animation of KITT's various monitor screens, but NO ONE has done anything like I am wanting to make. It don't need to be video exactly just look good & close on the screen. That image I provided is just what I found, but is maybe from those dvd's images?, but I need to get samples from my KR dvd's for better examples. I thought the hard part would be the KITT image, since the background is stationary.

    Edit: Just thought, could a bigger eeprom or an SD card be benifitial to this?
    potatohead wrote: »
    Do you have a particular target display in mind?
    Actually yes. The Knight Rider conversion community. I want to add a touch more of the show to people's replicas.

    Thanks all!
    Joe
  • Mike GreenMike Green Posts: 23,101
    edited 2015-04-09 11:24
    Look through the Display portion of the Propeller Object Exchange. The Graphics and TV objects are important starting points. This one (http://obex.parallax.com/object/507) is also helpful and illustrates some of the techniques you'll need to use. Again ... Although the Propeller is pretty magical in what it can do with NTSC/PAL video, it is limited in the amount of memory available for graphics buffers (2). The video generator is also limited in how many colors it can handle at a time, so you have to plan your display images around that. Moving large amounts of pixel data around can be slow in Spin depending on where the pixels fall in terms of long word boundaries ... You may need to rely on assembly language for some operations. Fortunately, the Graphics object has some of the operations you'll need and they're already in assembly language.

    As an example of how you might think ... Your display background might be constructed with ovals or circles with a common origin and different sizes and colors. Start with the whole screen in one color, then draw the largest "zone" in another color. Switch to another color and draw a smaller circle that overwrites part of the "zone". Use a 3rd color and smaller circle yet to form the next "zone" within the last. Keep cycling through the colors and drawing smaller filled circles inside the previous ones until you have the "zones" you want. Draw the lines for the radial markings and fill in the labels you want using the vector text drawing routines in Graphics. That's your background image. Graphics has routines for handling "sprites" which are graphics defined (as described in the source for graphics.spin) using bitmaps. They can be positioned within the graphics image and rotated as well ... perfect for KITT.
  • RaymanRayman Posts: 14,652
    edited 2015-04-09 13:41
    How big a display screen are you thinking about?

    For screens up to 5" or so, there are chips like the SSD1963 that the propeller can talk to do put high quality images on the screen...
  • jknightandkarrjknightandkarr Posts: 234
    edited 2015-04-10 00:16
    Mike Green wrote: »
    Look through the Display portion of the Propeller Object Exchange. The Graphics and TV objects are important starting points. This one (http://obex.parallax.com/object/507) is also helpful and illustrates some of the techniques you'll need to use. Again ... Although the Propeller is pretty magical in what it can do with NTSC/PAL video, it is limited in the amount of memory available for graphics buffers (2). The video generator is also limited in how many colors it can handle at a time, so you have to plan your display images around that. Moving large amounts of pixel data around can be slow in Spin depending on where the pixels fall in terms of long word boundaries ... You may need to rely on assembly language for some operations. Fortunately, the Graphics object has some of the operations you'll need and they're already in assembly language.

    As an example of how you might think ... Your display background might be constructed with ovals or circles with a common origin and different sizes and colors. Start with the whole screen in one color, then draw the largest "zone" in another color. Switch to another color and draw a smaller circle that overwrites part of the "zone". Use a 3rd color and smaller circle yet to form the next "zone" within the last. Keep cycling through the colors and drawing smaller filled circles inside the previous ones until you have the "zones" you want. Draw the lines for the radial markings and fill in the labels you want using the vector text drawing routines in Graphics. That's your background image. Graphics has routines for handling "sprites" which are graphics defined (as described in the source for graphics.spin) using bitmaps. They can be positioned within the graphics image and rotated as well ... perfect for KITT.
    I guess the background is going to be harder then I thought. LOL I will check that stuff out as well as reading the Hydra Manual. Thanks for the help.
    Rayman wrote: »
    How big a display screen are you thinking about?

    For screens up to 5" or so, there are chips like the SSD1963 that the propeller can talk to do put high quality images on the screen...
    It depends on the Knight dash one has. the 1 & 2 season dash has twin 5" & the season 3 & 4 dashes have a single 9" tv.
  • RaymanRayman Posts: 14,652
    edited 2015-04-10 08:42
    You can buy SSD1963 driver boards for LCDs up to about 5" and I have code to drive them on my website (somewhere).

    I also have a SSD1963 based product that can show full color images on a VGA monitor that would work for the 9" solution maybe.
    You couldn't do video speed though because it takes a second or two for the Prop to transfer a full VGA image to the SSD1963.
  • jknightandkarrjknightandkarr Posts: 234
    edited 2015-04-11 12:08
    The problem is, there are alot of people have store bought LCD tv/monitors, or the old CRT stuff. So I am going to need RCA output.

    Joe
  • potatoheadpotatohead Posts: 10,261
    edited 2015-04-11 17:08
    I think this can be done just fine on a TV.

    I also think the standard Parallax graphics driver can do a reasonable job. Since this really only needs to respond to a button, maybe blink a light, or make a sound, almost the whole Propeller can be dedicated to the graphics.

    Color is going to take some effort. A Propeller running a 320 pixel by 200 pixel display using the standard Parallax driver can deliver 4 colors per tile. Since the big image of the car needs to move, this might be easiest to assume a 4 color display.

    Choose black as one color, the off white as another, red and blue. TV displays blend pixels together nicely enough that it might make sense to dither the colored, circular regions to closely approximate the display. A bit higher resolution, say 480x200 or maybe 480x192, would help this dithering appear to be unique colored regions. On smaller displays, it's likely to work pretty well. So the key here is to pick 4 colors that can be blended to look reasonably close to the image you've shown us. And it might make sense to assign an additional color to the text in the upper right corner too.

    Doing that takes up 24K of the HUB memory, leaving 8K for buffers, code, and other things.

    I don't see the need for a double buffer display either. There is a whole screen to draw, but there are a lot of COGS to do it with too. I think this can be animated without a double buffer.

    Are there any other images of this sequence? And how important is color accuracy?
  • RaymanRayman Posts: 14,652
    edited 2015-04-11 18:34
    You might be able to do something with stock Prop video output, but I still think it would require heroic effort...
    This seems like something that would be relatively easy for raspberry pi. I've never used one, but I have two on my shelf and I see a NTCS composite output on them.

    I'm a big Prop fan, but cases like this I think are easier with other platforms...
  • potatoheadpotatohead Posts: 10,261
    edited 2015-04-11 18:40
    A Pi would reproduce this perfectly. I totally agree.

    All up to the OP.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2015-04-11 18:47
    potatohead wrote: »
    A Pi would reproduce this perfectly. I totally agree.

    All up to the OP.
    You could use an external RAM chip containing the buffer for the display data, and address through it, having its data pins tied to a RDAC, for video output. It should be possible to get up to 320x240 VGA using this method, with up to 15BPP (using RAM with a 16 bit data bus).

    Though there are other options, I think the method I mentioned is likely the best for use with the Propeller, and you can save pins by using SDRAM.
  • potatoheadpotatohead Posts: 10,261
    edited 2015-04-11 19:28
    Yeah, but then the difficulty level goes way up. Might as well use a Pi.

    https://learn.adafruit.com/pi-video-output-using-pygame/overview

    This isn't a hard thing for a Prop if one makes color trade-offs. From the looks of that link, it's not a hard thing for a Pi either.

    Depends on what the OP wants to do.

    Seems to me, a standard, easy to obtain board is the way to go. There is a community of enthusiasts who may well want to do the same thing.
  • RaymanRayman Posts: 14,652
    edited 2015-04-12 11:16
    I still haven't powered up my Pi's, but I bet they'd be better at this.
    Still, maybe my Manta board (coming soon) could do this...
    The SSD1921 can do direct reading from SD to it's memory at video speeds.
    Then, you just need to read the data as needed into a line buffer on the Prop.
    I have code to do this with flash chips, so it wouldn't be too hard to convert to Manta.

    One issue though is the byte color codes of Prop video... You'd have to use some program to convert to Propeller video palette.
    I've done that before with Photoshop for images, but video would have to be automated.
    It would be nice if could convert from RGB space to NTSC space on the fly, maybe it's possible.
  • potatoheadpotatohead Posts: 10,261
    edited 2015-04-12 12:11
    I went on you tube to see this sequence and many others. Frankly, I would do this as an animation, not video frames. True for Pi and Prop.

    I would deffo use a Pi for this task. There are actually a number of cool TV graphics that show up in the car. Rather than do just one at marginal quality, do a bunch and make a menu, or wire up some fun buttons.

    That link I put here is basically a frame buffer graphics library for the Pi and it can drive a TV display at broadcast quality resolution and color. Perfext, IMHO.

    The next thing I personally would do is get setup on the Pi, or setup a 480 pixel standard graphics screen on the Prop and in both cases work on colors, text, shapes...


    A Prop won't have the color depth needed, but could do a reasonable job if somebody were to take the time for some good pixel art.


    The problem on a Prop is higher numbers of colors don't happen at a high enough resolution to make sense. Low color or per tile color can make this graphic, but dithering and careful color selection is going to be required.

    The Standard graphics can deliver this, but it won't have the authentic look I see these enthusiasts going for.

    That Pi library has all anyone needs, IMHO. Use the GPIO for buttons, and it's a winner.
  • TubularTubular Posts: 4,702
    edited 2015-04-13 04:46
    Give it a go with the prop. Here's an idea of what you can do
    http://forums.parallax.com/attachment.php?attachmentid=85476&d=1317222769

    That graph is NTSC output but captured using Viewport. If you're using a smallish screen to fit a dashboard, the resolution mightn't be too bad... you can certianly do animations easily enough
  • jknightandkarrjknightandkarr Posts: 234
    edited 2015-04-13 12:20
    potatohead wrote: »
    I think this can be done just fine on a TV.

    I also think the standard Parallax graphics driver can do a reasonable job. Since this really only needs to respond to a button, maybe blink a light, or make a sound, almost the whole Propeller can be dedicated to the graphics.

    Color is going to take some effort. A Propeller running a 320 pixel by 200 pixel display using the standard Parallax driver can deliver 4 colors per tile. Since the big image of the car needs to move, this might be easiest to assume a 4 color display.

    Choose black as one color, the off white as another, red and blue. TV displays blend pixels together nicely enough that it might make sense to dither the colored, circular regions to closely approximate the display. A bit higher resolution, say 480x200 or maybe 480x192, would help this dithering appear to be unique colored regions. On smaller displays, it's likely to work pretty well. So the key here is to pick 4 colors that can be blended to look reasonably close to the image you've shown us. And it might make sense to assign an additional color to the text in the upper right corner too.

    Doing that takes up 24K of the HUB memory, leaving 8K for buffers, code, and other things.

    I don't see the need for a double buffer display either. There is a whole screen to draw, but there are a lot of COGS to do it with too. I think this can be animated without a double buffer.

    Are there any other images of this sequence? And how important is color accuracy?
    I would like to get the image as close as possible. I need to go over the dvd and get footage of the whole thing, I "think" there might be when the button is pressed that the image of the car launches off the screen, but I have to see. I hope it can because I know the propeller spin language...
    Rayman wrote: »
    You might be able to do something with stock Prop video output, but I still think it would require heroic effort...
    This seems like something that would be relatively easy for raspberry pi. I've never used one, but I have two on my shelf and I see a NTCS composite output on them.

    I'm a big Prop fan, but cases like this I think are easier with other platforms...
    I hope it can, but I guess if it requires the use of other platforms, I guess I can try..
    potatohead wrote: »
    A Pi would reproduce this perfectly. I totally agree.

    All up to the OP.
    I will check it out.
    You could use an external RAM chip containing the buffer for the display data, and address through it, having its data pins tied to a RDAC, for video output. It should be possible to get up to 320x240 VGA using this method, with up to 15BPP (using RAM with a 16 bit data bus).

    Though there are other options, I think the method I mentioned is likely the best for use with the Propeller, and you can save pins by using SDRAM.
    Do you mean regular computer connector VGA output?
    potatohead wrote: »
    Yeah, but then the difficulty level goes way up. Might as well use a Pi.

    https://learn.adafruit.com/pi-video-output-using-pygame/overview

    This isn't a hard thing for a Prop if one makes color trade-offs. From the looks of that link, it's not a hard thing for a Pi either.

    Depends on what the OP wants to do.

    Seems to me, a standard, easy to obtain board is the way to go. There is a community of enthusiasts who may well want to do the same thing.
    Thanks I will look at that video.
    potatohead wrote: »
    I went on you tube to see this sequence and many others. Frankly, I would do this as an animation, not video frames. True for Pi and Prop.

    I would deffo use a Pi for this task. There are actually a number of cool TV graphics that show up in the car. Rather than do just one at marginal quality, do a bunch and make a menu, or wire up some fun buttons.

    That link I put here is basically a frame buffer graphics library for the Pi and it can drive a TV display at broadcast quality resolution and color. Perfext, IMHO.

    The next thing I personally would do is get setup on the Pi, or setup a 480 pixel standard graphics screen on the Prop and in both cases work on colors, text, shapes...


    A Prop won't have the color depth needed, but could do a reasonable job if somebody were to take the time for some good pixel art.


    The problem on a Prop is higher numbers of colors don't happen at a high enough resolution to make sense. Low color or per tile color can make this graphic, but dithering and careful color selection is going to be required.

    The Standard graphics can deliver this, but it won't have the authentic look I see these enthusiasts going for.

    That Pi library has all anyone needs, IMHO. Use the GPIO for buttons, and it's a winner.
    Thanks I will look at it.
    Tubular wrote: »
    Give it a go with the prop. Here's an idea of what you can do
    http://forums.parallax.com/attachment.php?attachmentid=85476&d=1317222769

    That graph is NTSC output but captured using Viewport. If you're using a smallish screen to fit a dashboard, the resolution mightn't be too bad... you can certianly do animations easily enough
    I will check that out. Thanks.

    Joe
  • jknightandkarrjknightandkarr Posts: 234
    edited 2015-04-13 12:29
    Question on the Raspberry Pi. Is that a system that I can get the components and design my own or is it I buy program and in my case sell?

    Joe
  • potatoheadpotatohead Posts: 10,261
    edited 2015-04-13 12:54
    I did a few color dithering tests and found some examples.

    If you plan to sell these, I don't think the Prop will deliver the realism I see out there.

    Man! Some people have really gone all out on their cars! Cool beans.

    Anyway, you would buy a Pi, then develop the sequences, or just this one, but there are a few people might like from what I saw.

    And design an I/O board that connects to the Pi. That way, the people building can hook stuff up to their buttons, lights, etc...

    From there, you can sell a package, everything needed, or just Pi add on kits, IMHO.
  • TubularTubular Posts: 4,702
    edited 2015-04-13 15:53
    What size screen would this plug into Joe?
  • jknightandkarrjknightandkarr Posts: 234
    edited 2015-04-13 16:07
    4-5 in or bigger, but no larger then like a 9in.

    Joe
Sign In or Register to comment.