Video Library - Frame by Frame Modification

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

User avatar
Forest Goose
Posts: 377
Joined: Sat May 18, 2013 9:27 am UTC

Video Library - Frame by Frame Modification

Postby Forest Goose » Thu Jul 03, 2014 9:18 am UTC

This isn't an area of programming I'm familiar with, that said:

Is there any library/package/etc. that would, essentially, provide a loop over the frames of a video file, exposing them as bitmaps/pixel arrays, then taking the modified frames and building them into a second video? I would, potentially, like to increase the resolution, and a few other things - I have had success with my own methods applied to image files, but I have no idea where to start with video (and couldn't write something myself).

Thank you for any help:-)

-- It doesn't particularly matter to me what language it is in; especially if there is decent documentation.
Forest Goose: A rare, but wily, form of goose; best known for dropping on unsuspecting hikers, from trees, to steal sweets.

User avatar
PM 2Ring
Posts: 3652
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Mid north coast, NSW, Australia

Re: Video Library - Frame by Frame Modification

Postby PM 2Ring » Thu Jul 03, 2014 12:38 pm UTC

Do you know about FFmpeg? The FFmpeg command line utilities are very comprehensive, and you can probably do most things you want to do with a single FFmpeg command line, although in some cases you may want to use FFmpeg in a batch file / script that converts the video to single frames which you can manipulate using your own software and then recombine back into video.

It's pretty easy to do basic transformations with the ffmpeg program, but it does have lots of options, so it takes a while to learn all its capabilities and how to use them properly.

You can access the FFmpeg libraries in your own programs, if you really want to, but why put yourself through the extra hassle of learning the library APIs?

...

Another option is the MLT Multimedia Framework, which I've played around with a little bit, after I discovered that MLTmelt was installed on my Linux system.

User avatar
Robert'); DROP TABLE *;
Posts: 730
Joined: Mon Sep 08, 2008 6:46 pm UTC
Location: in ur fieldz

Re: Video Library - Frame by Frame Modification

Postby Robert'); DROP TABLE *; » Thu Jul 03, 2014 12:47 pm UTC

AForge in .NET has VideoFileReader and VideoFileWriter classes (under the Video.FFMPEG namespace) that contain ReadVideoFrame and WriteVideoFrame methods, which return/take bitmaps. It's effectively an interface on the FFmpeg, but might be easier to use than a batch/script file.
...And that is how we know the Earth to be banana-shaped.

KnightExemplar
Posts: 5494
Joined: Sun Dec 26, 2010 1:58 pm UTC

Re: Video Library - Frame by Frame Modification

Postby KnightExemplar » Thu Jul 03, 2014 1:15 pm UTC

Forest Goose wrote:This isn't an area of programming I'm familiar with, that said:

Is there any library/package/etc. that would, essentially, provide a loop over the frames of a video file, exposing them as bitmaps/pixel arrays, then taking the modified frames and building them into a second video? I would, potentially, like to increase the resolution, and a few other things - I have had success with my own methods applied to image files, but I have no idea where to start with video (and couldn't write something myself).

Thank you for any help:-)

-- It doesn't particularly matter to me what language it is in; especially if there is decent documentation.


Let me go about a different approach.

Avisynth is a (very basic) scripting language designed for video editors. For exapmle, increasing the size of a video can be as simple as:

http://avisynth.nl/index.php/AddBorders

Code: Select all

AddBorders(0, 86, 0, 86, $000000)


Or if you wanted to "zoom" into a video, you'd do:
http://avisynth.nl/index.php/GaussResize

Code: Select all

AviSource("dv.avi").BilinearResize(352, 240, 8, 0, -8, -0)


VirtualDub is typically the program I use when I write Avisynth scripts. All internal filters can be found here: http://avisynth.nl/index.php/Category:Internal_filters AviSynth also has access to some basic FFMpeg options.
First Strike +1/+1 and Indestructible.

speising
Posts: 2288
Joined: Mon Sep 03, 2012 4:54 pm UTC
Location: wien

Re: Video Library - Frame by Frame Modification

Postby speising » Thu Jul 03, 2014 3:21 pm UTC

the term you're looking for is Frameserver

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Video Library - Frame by Frame Modification

Postby troyp » Sat Jul 05, 2014 5:05 am UTC

Regarding ffserver, is it still reliably usable?

Ubuntu has switched to the libav fork for the last couple of years, so I have avserver rather than ffserver on my system, but the man page begins:
AVSERVER(1) wrote:WARNING: avserver is unmaintained, largely broken and in need of a complete rewrite. It probably won't work for you. Use at your own risk.

Which makes me wonder if ffserver is in the same state (because if not, why switch to libav?)

User avatar
Forest Goose
Posts: 377
Joined: Sat May 18, 2013 9:27 am UTC

Re: Video Library - Frame by Frame Modification

Postby Forest Goose » Tue Jul 08, 2014 6:31 pm UTC

Thank you for all the replies - I'm, now, leaning towards http://www.openshotvideo.com/2013/09/li ... n-and.html, has anyone used this before? I'm looking to minimize the amount of dealing with video stuff to focus more on the frame by frame stuff - this seems to fit the bill, but I've seen a few negative reviews. Haven't had a chance to give it a whirl yet. Still looking into some of the other options in this thread as well. Thank you again:-)
Forest Goose: A rare, but wily, form of goose; best known for dropping on unsuspecting hikers, from trees, to steal sweets.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 11 guests