Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
If you already have a way to capture each frame, say a a jpg, you can use mencoder or ffmpeg to convert them into a movie. For example, this will take a series of jpg's , like 0000001.jpg, 0000002.jpg, etc
#create a small speed adjusted file mencoder "mf://*.jpg" -mf fps=60 -o output.avi -ovc lavc -lavcopts vco +dec=mpeg4
or with ffmpeg
ffmpeg -f image2 -i image%d.jpg video.mpg # This command will transform all the images from the current direct +ory # (named image1.jpg, image2.jpg, etc...) to a video file named video. +mp
You can google for assemble images to avi ffmpeg

Also see z-charcoal-video-converter for how to use these programs from Perl. In this one, I rip the movie to jpgs and audio, process each frame to a charcoal effect, then recombine them. It does audio too, but you don't need that. It does show how to run the commands thru Perl's system, and handling of the jpg filenames. It's preferrable to put the jpgs in a separate sub directory, since there can be so many of them.

Oops, I just read that you can't save the images to disk first, so that kind of blows my method above away; but if you could somehow feed the frames to ffmpeg in a realtime stream, you may have some luck. Google for ffmpeg capture streaming frames . In that train of thought, see Webcam Streaming to Perl/Tk with ffmpeg


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

In reply to Re: 2d animation by zentara
in thread 2d animation by wanna_code_perl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-28 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found