News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

My Own Video Format File

Started by Farabi, April 07, 2010, 10:34:16 PM

Previous topic - Next topic

Farabi

Im planning to create my own video file format, what do you think? Should I keep going or just use existing format?

The Image compression would be .jpg, but the sound would be a raw wav format.
I will use my database function I created before to manage the data.

This is what comes to my mind

fVFFCreateVideo
fVFFAddFrame
fVFFAddAudio
fVFFClose


Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

clive

How would this differ from MJPEG+PCM in an AVI container? Or some other generic mux'ed format.

-Clive
It could be a random act of randomness. Those happen a lot as well.

oex

I dont like using jpg, mpeg or any other lossy compression.... My advice would be to look up everythng you can find on lossless compression and roll your own if being run by just your own application or use a well supported format if you want it played by users without your application....

This way when you want to use your video for another purpose you have full quality images and you can choose exactly how much processing you are going to use on compression for your specific task.... Computers get faster/more memory all the time but it's a lot harder to replace quality lost in lossless compression than it is to write a preprocessing routine.

5 years down the line your application will look a lot more professional and run fast
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

clive

Problem is loss-less compression works like crap on audio and video. They are both continuous analogue signals, and sampled imprecisely at some arbitrary frequency chosen to meet the needs of the eyes/ears/brain to process. Most of the compression of video frame comes from determining the parts that aren't changing, and to vectorize motion of large image chunks to achieve the same.

-Clive
It could be a random act of randomness. Those happen a lot as well.

oex

Quote from: clive on April 07, 2010, 11:46:56 PM
Problem is loss-less compression works like crap on audio and video.

Very true however look at it in real terms.... In the last 18 years I have 500x more bandwidth/RAM/Processor speeds.... it doubles every 2 years so if you get 10x compression with jpeg and 2x compression with lossless then in 2 years your application is more viable on market place.... I think in most instances jpeg/mpeg is probably a 20 year at most 'fad' just as many years ago when I started using the internet it was 90% text because my 14Kb modem took 5 mins to download a 1 Mb image.... When the bandwidth is generally available why would anybody drop quality? If you plan to put all your stuff in your own format why partially destroy it, we cannot see the detail changes maybe but my AI progs certainly can....
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

Farabi

Quote from: clive on April 07, 2010, 11:01:06 PM
How would this differ from MJPEG+PCM in an AVI container? Or some other generic mux'ed format.

-Clive

THere would be no different, I think it was just easier to create my own format than use existing one.
I guess the basic data structure would be like this


fFrame struct
nSize dd 0
lpPict dd 0
lpSound 0
nDelay dd 0
nFrame ends


I guess I will create a free dll to read the data, so other can use my co-dec.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

clive

I think you'd be better served keeping the audio and video in separate time stamped packets.

-Clive
It could be a random act of randomness. Those happen a lot as well.

Farabi

Or maybe I just put the sound as a mp3 file and adjusting the sound play time with the frame delay.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

hutch--

The problem with media is that it will keep getting bigger as hardware becomes more powerful. Who would have thought in 1990 that you would be shoving around 7 to 8 gig DVDs and with Blueray its about 25 gig. Coming generations of super high definition video and sound will see data at rates that sound rediculous now but will be accomodated by later hardware. Technically demand for greater resolution outstrips supply without massive costs in hardware, think of an SG box with 22 megapixel video at 100 frames a second to get some idea and even many-core processors will have problems keeping up with this or better.

mpeg/jpeg will be useful for a long time to come and improvements will keep tuning it better and better, I regularly rip audio at 320k variable and still end up 75 to 80% better off than raw wave files and its really hard to tell the difference.

There will always be a case for storage of raw source media but it will not be at the reproduction end for a long time to come.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

clive

Quote from: Farabi
Or maybe I just put the sound as a mp3 file and adjusting the sound play time with the frame delay.

In the playback code I'm familiar with the, the audio time base is the hard time line, and clocks at a fixed frequency. The video, with it's variable decompression time is paced against the audio playback position.

Typically the audio/video data needs to be in the same stream (file) so the recovery from the disc occurs in a linear fashion and the file system isn't jumping around servicing two distinct files. A network compatible stream, can't exist as two files, you can't seek back and forth, it's a monolithic linear lump. You then demux it in RAM, and pass the data to the audio or video codec to decode. After you get the decoded data back you have to synchronize it.

-Clive
It could be a random act of randomness. Those happen a lot as well.

Farabi

Yeah, 8 Gigs will cause the jpeg decompression slow down the system, espesially when I only used a few hundreds MB. If for example I used 40 MB for the temporary memory and it only fit for 100 frame, if it took 2 second for the decompression it mean each 100 frame the video will stopped for 2 second, and that was bad.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"