On Fri, Dec 5, 2008 at 2:28 AM, Cai, Xin <[EMAIL PROTECTED]> wrote:

> hi guys
> So I have been playing around with AV library for a few days and so far I
> gotten it to grab video from an IP camera and convert it to mpeg4 and write
> it to the disk.
> My code basically works by
> 1. grab frame from Video and decode it by calling avcodec_decode_video
> 2. encode the frame by calling avcodec_encode_video
> 3. write the frame to disk using av_write_frame
>
> Now I want to be able to further control the quality of the video I am
> writing to the disk. So I would like to know how can I change the frame rate
> of the video being written to the disk? Now base on the output_example.c
> file I thought that it is controlled
> by the AVstream *st->codec->time_base.den field. But when I tried to set
> that, all it did is slow down the rate in which the video is being played
> at. So lets say I have a 5 second video at 30 fps, now it plays it at 2fps
> but it takes 15 * 5 seconds to finish playing. So how can I get it to drop
> frames?
>
> My second question is, I also want to be able to strip away color
> information and turn the video to black and white. How would I do that?
> Thanks
>

use swscale to convert decompressed video from their pix_fmt (probably RGB32
or YUV420P) to a grayscale format


>
> Xin Cai
>
>
>
>
>
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to