[libav-api] libav and encryption
ubuntolog at gmail.com
Wed Aug 10 22:20:02 CEST 2011
Thanks, Ronald, will try to do futher reading in that direction.
2011/8/11 Ronald S. Bultje <rsbultje at gmail.com>
> On Mon, Aug 8, 2011 at 10:31 AM, Vadim Gusev <ubuntolog at gmail.com> wrote:
> > Hi there. I'm wondering if it's possible to find solution for situation
> > in right now. I need to modify existing app, that uses ffmpeg to
> > decode/encode video so it will work with encrypted files.
> > Basically i have encrypted video file, that i need to process, transcode
> > encrypt output stream. The goal is to not to store decrypted file but
> > decrypt, transcode and encrypt on the fly.
> > File is encrypted with twofish cipher. The main problem i see is: packets
> > size differs so i can not know how much should i decrypt and supply to
> > on each iteraton.
> > So the question is how to deal with situation where input file is not
> > actually a video file that can be supplied directly to libav, but should
> > pre-processed (decrypted in my case) and it can't be pre-processed at
> > entirely.
> > In other words, can I create sort of pipe which looks like: "read input
> > | decrypt | decode | process | encode | write output file".
> > Thanks in advance.
> If you intend to do the decrypting outside libav, you can look into
> using an AVIOContext. This is a structure that basically wraps our
> read/write/seek routines, you can basically make the read callback do
> the decryting on the fly and block while that's in progress. Supply it
> as AVFormatContext->pb while opening the media
> (av_open_input_stream()) and it'll work as you expect.
> Output encrypting is easy so I guess I won't go into that.
> libav-api mailing list
> libav-api at libav.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the libav-api