Log in

View Full Version : Alternate style of encoding?


Danux
24th September 2006, 02:58
Not quite sure how to pose this question, so perhaps I'll start by describing what I would like as a finished file.
I'd like to try and encode a few flicks with full stereo sound, but using still images changing at significant moments, rather than full motion video. Another way to look what I am after, would be to say that I'd like to make an "audio book" of a movie, but with stills to augment the soundtrack. It would have to be something more than grabbing a frame every 3 seconds, because I looking to use relevant, clean images, and the "frame rate" would vary with the relevance. A long speech by a character may need three images over 15 seconds, whereas a car chase or gun fight might use a frame a second.
Why encode this way? I prefer to be somewhat aware of my surroundings, on a bus or sitting public, etc, and I've watched most of my DVDs often enough that full motion video just isn't necessary any more. This is especially true for stage plays taken to the silver screen (Shakespeare, Glengarry Glen Ross, etc). Additionally, I can fit more entertainment onto a single piece of media, which gives me more variety on the move, or less expenditure on, say, SD cards.
Although I confess only mediocre knowledge of the whole encoding process, it seems to me that a codec like XviD already has the ability to detect scene changes, so perhaps grabbing the first frame of every scene change would be an "easy" way to automate the encoding process. A better, but more time-consuming, method would be to have a button to click, and as one watches a movie in real time, it grabs the stills as the user inputs them.
An additional appeal, in my mind, is that anything capable of playing XviD files right now should probably be able to play a "movie" encoded in this fashion.
I've seen Mac stuff where a user takes a series of JPEGs and dubs audio over it to make a movie, but I believe that takes a tremendous amount of user input for timing and editting.
Is something like what I am after already available?

GodofaGap
24th September 2006, 08:15
Perhaps you should try to set the framedrop ratio in XviD really high. It might achieve what you want.

check
24th September 2006, 08:18
well, the process you need is called variable framerate (vfr), and as far as I know, unless you simply just want to automatically decimate a fixed number of frames a second (which would still be cfr), there's little like what you want.
The only other idea that springs to mind is using dedup() with very high drop parameters.

Brother Darrell
27th September 2006, 04:33
I think what you are describing is an audio book with video illustrations.
This wouldn't need to be variable bitrate, just the length of the audio scene and pics that match the changing intensity of the audio would be enough.. (IE: audio change to a disapproving voice.. video change to a frown..or whatever is appropriate). If this is a correct way to describe what you want, then what you need is something that, in effect, sets an I frame & holds it for the duration of the particular dialogue, changing to a new frame when the intensity of the audio changes. Hmmm. You would think there would be a way to do this using Avisynth. Instead of using scene changes to set an I frame, using audio que's instead...

SergeyFedosov
27th September 2006, 09:13
Install Xvid, install VirtualDubMod.

Your task has to be done in two steps: 1. A 10-fold reduction of maximal interval between I-frames (key frames). 2. A 100-fold decimation of your video (removal of frames).

1. I-frames interval. Start VirtualDubMod. Open your file. Typically, the maximal interval between I-frames is 250 for PAL and 300 for NTSC, see information in the menu of VirtualDubMod, File, File Information. This interval MUST be reduced to, let us say, 25 or 30. In this way, there will be several I-frames per interval of 3 – 4 s (distance between frames in your final video). Change of I-frames requires complete recompression of video. Open menu Video and set Fast Recompression. Open Video, Compression, select Xvid (or whatsoever other codec you prefer), Configure. Now you have entered codec and have to change its configuration. In Xvid I suggest to select Encoding type – Single pass, below change Target bitrate to Target quantizer, then move slider to 2 (better quality, larger file) or 3 - 4 (slightly lower quality, smaller file). At the bottom of the window go to More, Quality preset, more... and Other, Maximal I-frame interval, set it 25 (PAL) or 30 (NTSC). Other parameters are of no particular importance in your case. OK, OK, OK. Go to File, Save As, xxxxxx.avi, Save and run recompression (it may take some time). Close VirtualDubMod.

2. Decimation. Start VirtualDubMod again. Open the recompressed file, e.g. xxxxxx.avi. Select in the menu Video, Direct stream copy. Select Video, Frame rate, go to Frame rate decimation, enter 100, OK. Select File, Save As, yyyyyyyy.avi, Save and run decimation (that would go very fast). The final file would contain your video where the image go in jumps of 3 – 4 s with accompanying sound. Decimation does not influence synchronization of audio and video.

Danux
29th September 2006, 16:01
Thanks for all the replies. I'll give your detailed explanation a run Sergey.