random access to video file
Is there a method for randomly accessing a video file in Python / OpenCV ?
A kind of fseek which would allow to go directly to frame n ...
Re: random access to video file
On Tue, 25 Sep 2012 01:51:43 -0700 (PDT), JRV
<email@example.com> declaimed the following in
> Is there a method for randomly accessing a video file in Python / OpenCV ?
> A kind of fseek which would allow to go directly to frame n ...
What format video file?
Most are some variation of IFF chunked data, possibly interleaving
the audio chunks with video image (especially in streaming formats --
whereas a fast drive might support having one video and one audio chunk,
doing a lot of seeking between the two during playback).
DV-AVI (as produced from standard definition miniDV tape cameras)
have video encoded as a stream of JPEG frames. Since JPEG doesn't
produce a constant output size for varying input, one can not just
compute a "jump n-frames forward" except by having processed all the
MPEG (memory card/disk based standard definition cameras and HDV
tape) uses a Group-of-Pictures concept, typically 15 frames to a GoP. A
GoP consists of one JPEG frame at the beginning, followed by a series of
changes from that frame (and those tend to have bidirectional change
frames saved between them). To modify one frame typically requires
regenerating the entire GoP.
AVCHD is even more compressed than HDV MPEG -- and a 13GB (1-hour)
HDV capture can easily expand to an 80GB "less-compressed" intermediate
file for editing on slower computers.
I suspect NLE software scans the video file during loading to build
an index of, at the least, where each video chunk begins and what frame
it starts on. With more memory, it may be possible to index by GoP.
(Sony Vegas appears to handle the audio by building a separate proxy
file of just the audio)
Wulfraed Dennis Lee Bieber AF6VN
|All times are GMT. The time now is 04:14 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.