mikeboers/PyAV — pull request #5 by markreidvfx (2013-08-14 01:44:37+00:00)
Title: Basic encoding support!

Okay this is a big one, too big. I promise I won't do a big one like this ever again. Really need to start writing tests now! I tried to add lots of docs and comments. see example/encode.py for a example.

Heres a small list of some the things I added or changed

open with mode "w" enables encode.
added mux method to Context (opposite of demux, takes a packet as a argument).
added encoding methods to VideoStream and AudioStream (opposite of decode, takes a Frame).
stream.codec is where you set your encoding options for your codec.
moved the reformatting of video frames from VideoStream to the VideoFrame object.
reformat(width, height, pix_fmt)
I also added a to_rgba() for convenience
Added resample method to the AudioFrame Object, very similar to reformat, but for audio.
resample(channel_layout, sample_fmt, sample_rate)
added Basic AudioFifo object, need for changing audio frame_size on certain codecs.

and lots more other stuff....