0

I know that this would be possible to implement with a Linux kernel module (i.e. you would "mount" a video file to access the frames), but I was wondering if there was another Unix-ish way to do this without going that far.

Is there some special file (maybe some magic with a pipe) that could reference specific frame in a video file that is seen as a .png to outside utils, but when edited updates the original frame in the video?

(I'm looking for a general file type/pseudocode. If it's an answer written in C, all the better)

It is possible with FFMPEG to access a single frame: Using avconv to get a single frame from h264 video at set time

... and inject it back in: https://forums.creativecow.net/thread/291/1315

Community
  • 1
  • 1
CharlesL
  • 265
  • 5
  • 21
  • Why don't you use a player than can output the frames as images? – Karoly Horvath Oct 16 '15 at 17:03
  • @KarolyHorvath I could use FFMPEG to export a bunch of .png files, but that requires a lot of initial processing (split frames apart), space (thousands of .png files take up more space than a video file of the same length) and final processing (to merge the frames back together). – CharlesL Oct 16 '15 at 17:09

1 Answers1

4

Is there some special file (maybe some magic with a pipe) that could reference specific frame in a video file that is seen as a .png to outside utils, but when edited updates the original frame in the video?

This isn't a thing that you could do usefully with most video formats. Frames are not stored independently in the file; video compression algorithms work by storing the differences between adjacent frames, so it is very difficult to update a single frame without altering all of the other frames which are related to it.

In any case, no; there is no way in a standard UNIX system to create a file that is linked in this sort of way to another file. What you could do, however, is create a FUSE file system that exposes the frames of a video as files in a virtual filesystem. This isn't a trivial task, though; for information on getting started, you may want to work through the FUSE tutorial:

http://www.cs.nmsu.edu/~pfeiffer/fuse-tutorial/

  • It is possible to access a single frame of a video (http://stackoverflow.com/questions/25308594/using-avconv-to-get-a-single-frame-from-h264-video-at-set-time), so wouldn't it be possible for a named pipe (frame1) to access the frame? Then somehow, inject the new frame back in (https://forums.creativecow.net/thread/291/1315). – CharlesL Oct 16 '15 at 17:18
  • It is possible to read individual frames out of a video file as described in that first link, but writing back individual frames is problematic. Anyways, named pipes won't do what you want either, as data only becomes available on the other end if it's been written to the pipe already, and having all that data resident in pipes would be bad. –  Oct 16 '15 at 22:02
  • Ahhh, gonna use FUSE then. Perfectly solves the problem. Thanks! – CharlesL Nov 03 '15 at 13:33