[libav-devel] Convert a video

Bernhard Pöchtrager bernhardpoe at gmail.com
Thu May 24 16:31:10 CEST 2012


Hello!
I want to change the libavformat/output-example.c to convert a video.
I add a new parameter. (forexample: ./output-example out.flv in.mpg) But
the problem is how to get the information of the file?
I think I need to get it in the variable  AVStream *video_st;
I searched in the source-code, but I couldn't find a way to load the
information.

    for (;;) {
        /* Compute current audio and video time. */
        if (audio_st)
            audio_pts = (double)audio_st->pts.val * audio_st->time_base.num
/ audio_st->time_base.den;
        else
            audio_pts = 0.0;

        if (video_st)
            video_pts = (double)video_st->pts.val * video_st->time_base.num
/
                        video_st->time_base.den;
        else
            video_pts = 0.0;

        if ((!audio_st || audio_pts >= STREAM_DURATION) &&
            (!video_st || video_pts >= STREAM_DURATION))
            break;

        /* write interleaved audio and video frames */
        if (!video_st || (video_st && audio_st && audio_pts < video_pts)) {
            write_audio_frame(oc, audio_st);
        } else {
            write_video_frame(oc, video_st);
        }
    }

I hope anybody can help

Thx Bernhard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libav.org/pipermail/libav-devel/attachments/20120524/f860e5bf/attachment.html>


More information about the libav-devel mailing list