I am looking for a right way to remove a MJPEG frame (one or more) from RIFF AVI record.
The problem is that I want the record to keep invariable playing time, i.e. if I remove say 25 consecutive frames, video should freeze for 1 second (displaying the last frame), while sound should play normally.
Any ideas?
+ Reply to Thread
Results 1 to 10 of 10
-
-
What is the background context? Why do you want to do this ?
What you're asking for, is essentially VFR (variable frame rates) . Frames can be set to display longer or shorter durations. That's not possible with AVI container, which is CFR (constant frame rate) only. However, it is possible with other containers, like MKV through the use of timecodes.
Functionally, fake-VFR in AVI container is done with frame repeats. So you would insert duplicate frames, to replace the ones you wanted "removed" . Compression wise, this isn't as "good" because actual frames are encoded and stored (larger filesize) as opposed to true VFR , where only a single frame is encoded for that period of "repeats"
MJPEG is intra-frame, so editing with frame accuracy is possble without the problems of long GOP -
I've made compact FullHD video recorder for special purposes, and I've got some inconvenience: some frames can be many times bigger in length than average. This forces me to lower average quality so that the peaks to fall into reasonable limits. Although the situation allows me just throw out such long frames.
Now I use RIFF AVI because it is very simple. Advise to use MKV? -
The quality is not affected after you have recorded it. So if you mean dropping frames after you've recorded it, the remaining frames will be unaffected since MJPEG is intra frame.
Or did you mean you are designing or making a recording device ? Well many modern devices (e.g. point and shoot cameras, phones, etc...) use VFR to record. They usually use h.264 in MP4 container (sometimes, MOV container) . The FPS increases and decreases according to activity (VFR), so you have more efficient recording. e.g. a static shot might have 1 frame representing a few seconds.
However, VFR causes many potential problems with editing and editing software -
Yes, I've done the recording device. It is VERY compact and low-power, so I should economize everything. Average bitrate is ~50 Mbps, and it is hard for my hardware to tolerate 150-200 Mbps peaks.
So, I have to choose the simplest container that supports VFR......... -
-
-
What is the "special purpose" ?
Sure , there are pros/cons to everything
Storage and bandwidth are important considerations for some situations also. If you need longer recording times, MJPEG will often not be acceptable.
Even intraframe h264 is significantly better (quality wise) than mjpeg.
In those cases where interframe encoding isn't acceptable , it's even less likely that true VFR is acceptable - only VFR with duplicates encoded into the stream -
I'd bet MPEG2-Intra at 50Mbps would still be (much) lower power/complexity than AVC or HEVC (though higher than JPEG/MJPEG or DV), but would be acceptable quality (easily for SD material, possibly for HD material). Might be a good compromise.
Scott