How can I extract frames from movie and save it to memory? I am using FFMpeg and I can extraxt frames to save in on disc but then I need to processing that files and load it to memory. Is there any way to save them directly into RAM ?
Related
So I'd like to stream video from an RTSP stream using OpenCV, and immediately save the raw video to a file without decoding. We need high performance and might be processing as many as 500 cameras on one machine. Which means that even though typically small and 2% CPU, the extra 10x CPU needed to decode every frame adds up. When I run with ffmpeg command line it's getting so little usage it shows 0.0% CPU.
The recommendation I've seen before is just use ffmpeg, reason I'd like OpenCV is:
A) We might need to do some image analysis in the future, wouldn't be on all frames though, just a small sample of them, so all still need to be saved frame by frame to file without decoding, but some will separately be decoded.
B) Simpler to implement than ffmpeg (that in the future would need to pass select frames to OpenCV)
Edit: I've tried using VideoWriter::fourcc('X', '2', '6', '4'), and -1 in order to try to skip encoding. Seems like it goes ahead and does it anyway even though it's already in that format?
Thoughts? Thanks!
I'm porting cobalt release_11 (11.119147) to my STB .
I want to reduce the cobalt memory usage when play 4K Video to the 180M .
Cobalt will add about 140M of memory(all 250M memory) when playing 4K video from the youtube homepage, most are used as media buffer to cache demuxer media data.
I find the base.gypi have a parameter config: cobalt_media_buffer_storage_type as follows:
# This can be set to "memory" or "file". When it is set to "memory", the
# media buffers will be stored in main memory allocated by SbMemory
# functions. When it is set to "file", the media buffers will be stored in
# a temporary file in the system cache folder acquired by calling
# SbSystemGetPath() with "kSbSystemPathCacheDirectory". Note that when its
# value is "file" the media stack will still allocate memory to cache the
# the buffers in use.
'cobalt_media_buffer_storage_type%': 'memory',
when it set to "file", it will add define "COBALT_MEDIA_BUFFER_STORAGE_TYPE_FILE=1" ,
But I did not find any source code about COBALT_MEDIA_BUFFER_STORAGE_TYPE_FILE , Whether this configuration is still valid?
Is there a better way to reduce memory, except as described in memory_tuning.md
Sorry, Cobalt currently doesn't support caching media buffers in file system.
Is it possible for you to tell us the purpose of the optimization? Are you trying to make Cobalt support 4k playback on a system with limited memory, or are you trying to optimize the memory footprint of Cobalt just to see if it can take less resource on your target system?
After recording a video the API allows for the generation of a thumbnail of any size. I was originally going to cache the thumbnail to disk with the video but I'm curious of it's faster to just generate on the fly instead. Anyone have any data on this?
In my iOS app, I have large PCM files. I understand that the OpenAL buffers reside in memory. Is it possible to get the buffers to stream from disk instead?
Thanks.
I am doing a process in which i compress files of all types,for compression/decompression i used GZipStream class ,i easily compress all types of files but when it comes to a video file the compressed filesize is more than the original filesize
so the purpose of compressing gets spoiled.how to compress a video file without losing the
quality of the video successfully.
ok i accept this.but what about the winrar
Most of the formats are already compressed. Just by converting from format to format you most likely will kill the quality without gaining much in limiting the size
Your video files are already compressed, which is why compressing them again increases their size.
You cannot compress them further without losing quality.