- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi
I have a source code of compression vidéo (h.264 ,jpeg) how is exécutable in visual studio c++,my problem is how to implement this code in NiosII ,how to convert this source code in niosII. thanks in advance.Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How did you generate the zip file? Did you remember not to use compression? Where and how did you flash it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Now I want to load an image from memory flach to compress and sauvgardement in another file (. jpg) . So to access this picture I cried (/ mnt / rozipfs / file / cross.bmp), the problem is I can not find the file (. jpg)!!
In principle it was created in the project and sauvgardement.plz help me.thanks in advance.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
are you trying to write a file back to the rozipfs? If yes you can't do that, it is a read only file system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks Daixiwen, i don't inderstand your message ,My code opens a file (. bmp) and compress it into a image.jpg.
the problem is I can not find the output file (. jpg). when it must be found.thanks in advance.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
do you know, where are you trying to save the Jpeg image?
rozip is read only zip, you can not write back jpeg file into rozip. by the way. have you found the way to use compress logic. congratulations anyway.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi ,thanks akira,
where shall i write back the jpeg file? what is the root of this file(.jpg)? thanks in advance.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can't write back the file. For that you would need a filesystem with write support, which isn't available in the standard Nios distribution. What is your objective exactly? Why do you want to write a file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,thanks Daixiwen,
i have a compression code and i want to test it.that's why i need to read the output file of this code which will create a new write file . JPG_filename="image.jpg" if((fp_jpeg_stream=fopen(JPG_filename,"w"))==NULL) { perror("Impossible to open write file"); exit(-2); } printf("file opened\n"); what shall make as a root to read this write file cause i always have this message " Impossible to open write file: no such device" thanhs..- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will either have to find or implement a different file system with write access, or use another method. For example instead of a file, you can put the JPEG data in a table or an allocated memory buffer and re-read it from there.
An alternative is to use the host file system instead of the rozipfs, and then you can directly read/write files on your PC. But this will only work when running the application with the debugger, not if you directly execute it.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi Daixiwen, thanks a lot.
What do you mean from "allocated memory buffer and re-read it from there", is that mean "Writing the output files to the flash memory"? thanks in advance.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, I didn't mean using the flash, I meant not using files at all and just keep the data in memory. What do you want to do to the compressed data once you compressed it? Do you really need to write it to flash?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi Daixiwen,thanks a lot.
how to keep the data in memory(not falsh memory)? i need to write the compressed data(.jpg) in the flash memory (if it is possible and easy).because after write in flash memory i want to read with a web server (...). i can write a file in flash memory?? thanks in advance.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your code probably use fwrite() to write the data to a file. Instead of doing this, just keep the buffer allocated. You can probably modify the web server code to use a pointer to that buffer and directly return its contents instead of reading a file on the system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks a lot Daixiwen.
if i use the buffer allocated I must call a file in the memory as in include in the memory.h file in visual studio, so what is the file called when I use the buffer in the environment NiosII? thanks in advance.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have no idea what the memory.h file includes, it doesn't seem to be standard C. In C you can just use the standard malloc() and free() functions to allocate or free a buffer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi Daixiwen,
when i allocated the data in memory using the buffer ,so how to read the data? thanks in advance.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
all right then.
this is not good answer. but still a way. why don't you use "printf" to show your data on your nios2-terminal. just print your result sequentially. and analyze it after you store the data into text file. as I told you, this is not good way. but, since we don't know (you may not know) what device your FPGA has. we can not tell what you can do. do you have MMC(SD-card) device on your FPGA? can you connect FAT formated USB-Memory? do you have Ethernet adopter and able to send data via that? I don't think so. that's why, we can not advice.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks Akira, yes i have Ethernet adopter and able to send data via fpga and pc. my data is a image(.jpg), i write the data in flash memory but i don't know how to read the data and display this data(image .jpg) from the flash memory:
if i write a integer(i=10) in the flash memory i can read it with printf(i). but when i write a file in flash memory, i don't know how to display it?? thanks in advance.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hum, interesting.
you have Ethernet connection, but not be able to write a file. anyway 1. flash file. you can not open file on the flash memory. because,( I think ) your system does not have FAT access. 2.Network you say you can send data via Ethernet. all right why don't you use it. when your program tries to write jpeg data, your code must have compressed image on you memory(ram) right? then send whole those data to you computer via Ethernet. I can't tell why you can not save files on your flash because I don't know how do you construct your system. I don't know if sending data via Ethernet satisfies your request, but you can make sure your jpeg-program works or not. how about that?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi akira,thanks a lot,how i can't write the data (image file .jpg)in flash memory ?
i want to write a file(.jpg) in flash memory then read and display this file. so what should i add to be able to read the file? if i write the data in memory Ram ,this is the same problem (how to read and display this file!!) thanks in advance.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi
pleaz, i can add a fat(file system) in flash memory? if yes how ? thanks in advance.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page