[MPlayer-dev-eng] [PATCH 1/3] make lavc dv encoding work in mencoder

Michael Niedermayer michaelni at gmx.at
Sun May 13 23:05:19 CEST 2007


Hi

On Sun, May 13, 2007 at 12:14:01PM -0700, Corey Hickey wrote:
> Michael Niedermayer wrote:
> > shouldnt the fallback rather use mp_bmp_tags ?
> 
> How about this? It actually makes the current code be the fallback when
> libavformat is not included, akin to what happens in ae_lavc.c.
> 
> I've tested all the encoders listed in the old code to make sure the
> fourcc is found appropriately. The all work except:
> 
> mpeg1:
> There's no point in finding a fourcc for this if
> avcodec_find_encoder_by_name() fails anyway (it should be mpeg1video).
> In other words, "-lavcopts vcodec=mpeg1" never worked anyway. So, I've
> removed it from the fallback code as well.
> 
> mpeg2:
> Same as above.
> 
> rv10:
> There's no fourcc in libavformat/riff.c; patch sent to ffmpeg-devel.
> 
[...]
> -    if (!strcasecmp(lavc_param_vcodec, "mpeg1") || !strcasecmp(lavc_param_vcodec, "mpeg1video"))
> +    if (!avcodec_inited){
> +	avcodec_init();
> +	avcodec_register_all();
> +	avcodec_inited=1;
> +    }
> +
> +    vf->priv->codec = (AVCodec *)avcodec_find_encoder_by_name(lavc_param_vcodec);
> +    if (!vf->priv->codec) {
> +	mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_MissingLAVCcodec, lavc_param_vcodec);
> +	return 0;
> +    }
> +
> +#ifdef USE_LIBAVFORMAT
> +    mux_v->bih->biCompression = av_codec_get_tag(mp_bmp_taglists, vf->priv->codec->id);
> +#else

iam wondering how often i need to say that av_codec_get_tag() is only
supposed to be used with lav* opaque codec tag lists and not with
externally provided ones

here this in addition to the ABI/API issues leads to a dependancy on
libavformat

may i suggest again that mplayer would use its own function to find
a codec_tag from a codec_id for its private lists and use av_codec_get_tag
only for the lav* lists


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20070513/b00f287f/attachment.pgp>


More information about the MPlayer-dev-eng mailing list