[Libav-user] converting avi audio and video to dvd mpeg2 with ac3 audio

Anshul anshul.ffmpeg at gmail.com
Wed Jul 23 20:10:01 CEST 2014

On July 21, 2014 9:04:59 PM IST, 0xnullptr <0xnullptr at gmail.com> wrote:
>Thankyou for replying. I'm new to libav* suite of libraries, as you can
>probably tell.
>Oh, how embarassing!
>I am mistaken as I was looking though the source at so many parts. My
>Its the 'target' parameter option that I should be referring to in this
>I managed to follow the source code through the command line parsing up
>} else if (!strcmp(arg, "dvd")) {
> opt_video_codec(o, "c:v", "mpeg2video");
> opt_audio_codec(o, "c:a", "ac3");
> parse_option(o, "f", "dvd", options);
> parse_option(o, "s", norm == PAL ? "720x576" : "720x480", options);
> parse_option(o, "r", frame_rates[norm], options);
> parse_option(o, "pix_fmt", "yuv420p", options);
> av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18",
>av_dict_set(&o->g->codec_opts, "b:v", "6000000",
> av_dict_set(&o->g->codec_opts, "maxrate", "9000000",
>av_dict_set(&o->g->codec_opts, "minrate", "0", AV_DICT_DONT_OVERWRITE);
> av_dict_set(&o->g->codec_opts, "bufsize", "1835008",
>AV_DICT_DONT_OVERWRITE); // 224*1024*8;
> av_dict_set(&o->g->format_opts, "packetsize", "2048",
>AV_DICT_DONT_OVERWRITE);  // from www.mpucoder.com: DVD sectors contain
>bytes of data, this is also the size of one pack.
> av_dict_set(&o->g->format_opts, "muxrate", "10080000",
>AV_DICT_DONT_OVERWRITE); // from mplex project: data_rate = 1260000.
>mux_rate = data_rate * 8
>av_dict_set(&o->g->codec_opts, "b:a", "448000",
> parse_option(o, "ar", "48000", options);
>and I think it's these parameters that I need to set via api calls from
>code? I don't quite understand the role of the AVDictionary and how it
>into the library.
>or is it really as simple as 'av_guess_format("dvd",NULL,NULL);'?
>Are there resources available on the net so that I could learn the
>reasonably well?
>Or do I need to roll up my sleeves and dive in to the source code and
>that I don't drown?
>So far I'm using AVCodec* to set the encoder to
>AVCodecContext* to set the width,height,time_base( as AVRational {1,25}
>),max_b_frames to 2.
>As I'm new to libav I find that I'm a little in the dark as to the best
>direction to take for self help and to  help learn to get to grips with
>correct parameters to set.

I would suggest go through doc/examples, if you have some use case that use some feature not explained in examples, Ask here.
If any feature is worth explaining and nothing in examples,( you figure out debugging in ffmpeg it) then make one example and send patch.

>Sometimes I get the feeling that I'm getting in too deep with the
>and there are more appropriate settings that I can and should be using,
>possible like the one you've suggested. 
>Any pointers and help in the correct direction would be very much
>View this message in context:
>Sent from the libav-users mailing list archive at Nabble.com.
>Libav-user mailing list
>Libav-user at ffmpeg.org

Sent from my Android device with K-9 Mail. Please excuse my brevity.

More information about the Libav-user mailing list