Nora Registered: 02/10/08
Posts: 62
|
|
|
Reply with quote | #1 | Happy New Year!
If I want to run a movie file, in Gif format, do I just upload it to Graphics Composer as a movie file? I have done this, moved the gci and dat files into USD card and used the 4DGL program TestImageControl to test the gif file. The gif file loads (I tried this with 2 different files) and shows on the display as a still, but does not animate.
Also, what parameter should go in the USD function uSD_SetSector("SectHiWord", "SectLoWord"), 0; Where do I find these numbers? Any help is appreciated! Nora
|
| |
Nora Registered: 02/10/08
Posts: 62
|
|
|
Reply with quote | #2 | Also, I am using the FAT16. Card is formatted that way. When I use Graphics Composer the output txt file from a .mpg or .avi has no height of width. For example: Width = 0 Height = 0 Bits = 16 The other files GCI and DAT have almost nothing in them.
For a gif file, following is output- also files GCI and DAT have some random stuff in them just like regular jpg: The documentation is confusing because some of it points to being able to just insert a movie file into GC just like image and play using sample 4DGL.
Other posts seems to refer to putting a jumper in (slide show?? but not for 32028-P1T) and accessing the sectors one by one.
I am looking at the documentation posted by smacmanus about how to get started. ??? File "C:\Documents and Settings\Owner\Desktop\girl_book.gif" Location = 0x200000(2097152) Width = 112 Height = 128 Bits = 16 64, 86, 8, 0, 112, 128, 16, 100, 0, 16, 0, 16, 0 Cmd (0) = 40 Cmd (1) = 56 Cmd (2) = 8 Cmd (3) = 0 Cmd (4) = 70 Cmd (5) = 80 Cmd (6) = 10 Cmd (7) = 64 Cmd (8) = 0 Cmd (9) = 10 Cmd (A) = 0 Cmd (B) = 10 Cmd (C) = 0 Cmd (D) = B Cmd (E) = 0 Cmd (F) = 0 Cmd (10) = 0 Cmd (11) = 0
|
| |
kevingill
Registered: 21/06/08
Posts: 137
|
|
|
Reply with quote | #3 | Nora,
I've never used animated GIFs before, so I thought I'd give them a go! I've used the following 4DGL code to show an animated GIF:
#platform "uOLED-32024-P1T" func main()
gfx_Cls();
uSD_Init();
uSD_SetSector(0x0000, 0x1000);
repeat uSD_Video(0,0); forever
endfunc
In GC I inserted a movie with the animated GIF and loaded it onto the card with "Comm Port/Drive"= "E:", "Write Command Block" = "No", "Image Format"="Image & Pixel Data (V2)". I then took out the uSD card from my USB adaptor and popped it into the Picaso display and loaded the 4DGL program above.
I've included the animated GIF as an attachment - quite appropriate for the time of year - well I think it looks like Rudolph...
Attached Thumbnails:
|
| |
Nora Registered: 02/10/08
Posts: 62
|
|
|
Reply with quote | #4 | Kevin, thank you for great instructions!! That works great. Here is the interesting thing: I was loading from GC to my desktop the two files GCI and DAT. Then drag and drop these two files to E:, which in my case happens to be the USD card. The two files GCI and DAT are tangible files that come with a TXT file.
Using exactly the method you describe: something invisible (to me) loads onto the USD card and the TXT file shows up on my desktop. This explains why the sample code from usd_video() didn't work for me....the wrong thing was on the USD card!
So...what IS on the USD card that is invisible? Nora
|
| |
smcmanus
Moderator
Registered: 19/03/07
Posts: 471
|
|
|
Reply with quote | #5 | The options available for displaying images and video can be confusing. It breaks down to two methods of storing the image/videos and three ways of displaying them. Here goes.
The options that Kevin described for GC, places image/video header information and the raw image/video pixel data on an unformatted uSC card with the first image/video located at byte address 0x200000(DEC 2097152). See the .txt file, "Location=" parapeters, for the byte location of any additional files that may be written to the uSD card by the GC.
The 4DGL code that Kevin posted, sets the 4 byte sector address, 0x0000, 0x1000 required by the subsequent uSD_Video(); command.
This and the other options for storing and displaying images and videos is described in the document that can be found in the thread: http://www.websitetoolbox.com/tool/post/4d/vpost?id=3047573
The above post describes three different scenarios that include serial and 4DGL using FAT16 and unformatted uSD cards. Understanding the requirements and the steps required to create and access the image/video data/files in each scenario is the key to success and happiness when it comes to images and video on the 4D Systems displays.
Good luck,
Steve __________________ Any technology, sufficiently developed, is indistinguishable from magic. A.C. Clark(RIP)
NEW! Lower prices on all 4D Systems products for 2009!
http://shop.littlepcbsolutions.com |
| |
max66 Registered: 05/01/09
Posts: 4
|
|
|
Reply with quote | #6 | Hi There,
first of all happy new year to everybody.
Second : pls be very patience, as I'm new to this forum; yet, I spent enough time in looking for the info I need before writing this (maybe I looked in the wrong places...).
I bought a 32028-P1T (plus a uUSB-MB5), which I'm using with a FAT16 formatted 512Mb uSD : the target for me is to have the display working as an independent remote user interface, using serial port to talk to/from a host and receiving sound/images/video files to be displayed/reproduced. Dealing with "received files" is the reason for which I need to have the uSD formatted FAT16.
Environment I use : PC with Vista, 4DWorkshop 2.3, Composer 2.0.1.2, Pmmc 1.06.
Now the question.
Maybe I misunderstood the way in which animated gif & video are handled, but even looking at the "Getting started..." thread I'm not able to see my imaged "animate" : just a still image.
I understand that by writing "directly" to uSD card, the informations that implements the animation (the control block, right ?) are written somewhere; this doesn't happen when I write directly to .CGI
I used Composer to create a MAX project , than loaded the same animated .gif file posted by Kevingill inserting it as a "movie". Then I "loaded" it, having two files (MAX.CGI and MAX.DAT), which I manually moved to the uSD.
My very simple program (omissis lines before and after) :
------------------------------------------------------
img := file_LoadImageControl("MAX.DAT", "MAX.GCI", 1);
print ("Loaded ", img[IMG_COUNT], " images \n");
n := 0;
while (n <= img[IMG_COUNT])
img_SetPosition(img, n++, 10, 100);
wend
while (1)
// n := 0;
//while (n <= img[IMG_COUNT])
// img_Show(img, n++);
// pause (50);
img_Show(img, ALL);
// wend
wend
-----------------------------------------------------------
Well, I was expecting the image file to shown as an "animated gif", but it doesn't.
The commented lines You see in the code are there because, after trying and trying, I used a tool to save all the frames from the original animated gif as "individual gif files" : of course, displaying each frame (as single images) at the same position works (either by using the img_Show () on each index in the inner loop, or using img_Show with ALL parameter).
The question is : GC treat each image with a type of "movie" or "image", but seems that this do not make any difference when showing the object; does PICASO/PmmC actually implements the animation logic to treat .GIF/.MP4 files on FAT16 as a "unit" (being able to display each frame in sequence) or do I have to load any single frame ?
This carry to many other questions related to Graphic Composer, like the usability of the "movie buttons" under the bottom-right canvas : when I load either an .MP4 or an animated .GIF I'm not able to use them. Is a fault of MS Vista or am I using Composer in the wrong way ?
Many thanks in advance for anybody clearing my misunderstanding.
Bye
Max __________________ MaxC |
| |
max66 Registered: 05/01/09
Posts: 4
|
|
|
Reply with quote | #7 | Hi there,
could someone help me, pls. ? See my previous message on using movie/animated gif files on FAT16 uSD.
Many thanks to anybody helping me understanding where I am wrong...
Max __________________ MaxC |
| |
kevingill
Registered: 21/06/08
Posts: 137
|
|
|
Reply with quote | #8 | Max,
I haven't used the image control functions very much, but it appears that you can't show an animated GIF using the img_Show command - someone else may have experience of this.
I'd suggest you try the uSD_Video / uSD_Image commands instead to do what you want to achieve.
Good luck!
|
| |
max66 Registered: 05/01/09
Posts: 4
|
|
|
Reply with quote | #9 | Thanks Kevingill,
as I mentioned before those commands relates to uSD not FAT16 formatted : I already tested what You previously posted, and it works for me. Unfortunally I need to have a filesystem like FAT16 to easily handle files sent by a host to my 32028-P1T.
I thought that GC would create .CGI and .DAT by loading objects and "tagging" them as "movie" or "image", in order to have file_LoadImageControl() to treat them appropriately : as far as I understand this happens only if Pmmc could read "raw" data from uSD, while from FAT16 an img_Show() would only display the first frame.
Well, at least I'll have to export all my movies to single-frame images and create a .CGI/.DAT file to display them in sequence....
If no-one thinks this will be fixed in a future release of PmmC, well thanks a lot to everybody....
__________________ MaxC |
| |
Nora Registered: 02/10/08
Posts: 62
|
|
|
Reply with quote | #10 | Hello- Max, I have the same setup to you, except am using Windows XP. I've found that using the directions in the Getting Started file with moving the GCI and DAT into a FAT16 formatted card does not work with animations at all. Using Kevingill's instructions for animations works perfectly with gifs and with some avi files. So far no luck with mpg. The movie that I want has far too many frames to load one by one.
The odd thing is that when I load the animation to the USD card (again using Kevin's instructions) there appears to be nothing on it. Right clicking shows 0 bytes...I cannot find any hidden files. Yet there is something on it since the animation plays on the OLED.
Also- the movie play button not doing anything is the same for me in Windows XP.
Since I don't understand how the pmmc and composer work together to create a file that the OLED can use (although I'd be psyched if someone told me), I'm just using trial and error. ~Nora
|
| |
mvandere Registered: 19/11/07
Posts: 136
|
|
|
Reply with quote | #11 | Kevingill's instructions use the USD card without a file system. The 'files' are just written to the USD card into a 'known' location.
Since there is no file system windows (which expects a file system) will show nothing. Actually, I'm surprised Windows doesn't tell you the card is unformatted and ask you if you want to format it now. But that's probably just because of the contents of the data.
You could format a portion of the card as FAT16 and then use the rest of it 'without a file system'. One of the sample programs has comments about this in it, can't remember which one, though.
I really expect/hope that file_Video will make an appearance in the Language with the next release |
| |
max66 Registered: 05/01/09
Posts: 4
|
|
|
Reply with quote | #12 | Well,
thanks to everybody, while waiting for file_Video()..... __________________ MaxC |
| |
Jackson Registered: 21/10/09
Posts: 1
|
|
|
Reply with quote | #13 | Nora,for create your's video into a gif ,you can also try use VidGif,very simple programm.Good luckĀ |
| |