title: Store a video in a SQLite database?
body: <p>I'm working on an algorithm which needs very fast random access to video frames in a possibly long video (minimum 30 minutes). I am currently using OpenCV's VideoCapture to read my video, but the seeking functionality is either broken or very slow. The best I found until now is using the MJPEG codec inside a MKV container, but it's not fast enough. </p>
  
  <p>I can chose any video format or even create a new one. The storage space is not a problem (to some extents of course). The only requirement is to get the fastest possible seeking time to any location in the video. Ideally, I would like to be able to access to multiple frames simultaneously, taking advantages of my quad-core CPU.</p>
  
  <p>I know that relational databases are very good to store large volumes of data, they allows simultaneous read accesses and they're very fast when using indexes. </p>
  
  <p>Is SQLite a good fit for my specific needs ? I plan to store each video frame compressed in JPEG, and use an index on the frame number to access them quickly. </p>
  
  <p>EDIT : for me a <em>frame</em> is just an image, not the entire video. A 30mn video @ 25 fps contains 30*60*25=45000 frames, and I want to be able to quickly get one of them using its number. </p>
  
  <p>EDIT : For those who could be interested, I finally implemented a custom video container saving each frame in fixed-sized blocks (consequently, the position of any frame can be directly computed !). The images are compressed with the turbojpeg library and file accesses are multi-threaded (to be NCQ-friendly). The bottleneck is not the HDD anymore and I finally obtained much better perfs :)</p>