[MPlayer-dev-eng] tv input problems and partial solutions

Paul Ortyl ortylp at 3miasto.net
Sun Jun 23 20:28:23 CEST 2002


On Sun, Jun 23, 2002 at 07:17:37PM +0200, Alex Beregszaszi wrote:
> Hi,
> 
> > What does mencoder need from input stream to get proper A-V sync???
> > Maybe some timestamps???
> it uses timestamps now

Are you sure, that tvi_v4l module passes the information about timestamps to
mencoder and non-time-uniform frame sampling is corrected???


> thx for this patch, applied it

The patches you've applied DO NOT WORK!

The reasons:

*****
in mencoder.c:

the call:
len = lame_encode_buffer(lame, tmp, tmp, len/4,
	                      mux_a->buffer+mux_a->buffer_len,
                         mux_a->buffer_size-mux_a->buffer_len);

must be replaced by 

len = lame_encode_buffer(lame, tmp, tmp, len/2,
	                      mux_a->buffer+mux_a->buffer_len,
                         mux_a->buffer_size-mux_a->buffer_len);

NOT len/4 but len/2 (the buffer does not contain intrleaved data, so each
sample consists od two bytes (not four ones)).
*****

There is another 'lame_encode_buffer_interleaved' a few lines below outside the
case statement.  I have not analysed why this one is needed (the same code
in two places!!!) but the 'if(channels=1) {lame_encode } else {lame_encode}'
is needed much more there (see my patches again).

*****

You have added also such line in mencoder.c:

 mux_a->wf->nChannels=(lame_param_mode == 3) ? 1 : sh_audio->channels;

It will not work properly in situation, where the tv input audio is a stereo
interleaved stream and user wants to encode it as mono stream!  It should be
left as before:
 mux_a->wf->nChannels=sh_audio->channels;

********************************************************

I still have no idea how to make A-V sync correct (at least constant)...

Arpi: Do you have any hints???

Regards,

	Paul


-- 
Paul Ortyl <mailto:ortylp at 3miasto.net>
  Technical University of Gdansk, Telecommunications Faculty
--



More information about the MPlayer-dev-eng mailing list