[FFmpeg-soc] [soc]: r553 - in dvbmuxer/muxer_dev: Makefile dvbmuxer.diff mpeg_pes.h mpeg_pes_enc.c mpegtsenc.c

realsun sunxiaohui at dsp.ac.cn
Tue Jul 31 04:20:36 CEST 2007


Baptiste Coudurier wrote:
> Hi Xiaohui,
>
> realsun wrote:
>   
>> Author: realsun
>> Date: Mon Jul 30 14:50:30 2007
>> New Revision: 553
>>
>> Log:
>> modified pcr calculation.
>> generated ts stream still could not played well under vlc.
>>     
[...]

>> [...]
>>
>> Modified: dvbmuxer/muxer_dev/mpegtsenc.c
>> ==============================================================================
>> --- dvbmuxer/muxer_dev/mpegtsenc.c	(original)
>> +++ dvbmuxer/muxer_dev/mpegtsenc.c	Mon Jul 30 14:50:30 2007
>> @@ -62,8 +62,9 @@ static void mpegts_write_section(MpegTSS
>>              b |= 0x40;
>>          *q++ = b;
>>          *q++ = s->pid;
>> -        s->cc = (s->cc + 1) & 0xf;
>> +        s->cc = (s->cc) & 0xf;
>>          *q++ = 0x10 | s->cc;
>> +        s->cc++;
>>     
>
> What was the problem with previous code ?
>   

the first continuty counter should be 0, the old code will produce 1.
>   
>> [...]
>> -        int codec_rate;
>>          st = s->streams[i];
>>          ts_st = (MpegTSWriteStream*) st->priv_data;
>> -
>> -        if(st->codec->rc_max_rate || ts_st->id==VIDEO_ID)
>> -            codec_rate= st->codec->rc_max_rate;
>> -        else
>> -            codec_rate= st->codec->bit_rate;
>> -        bitrate += codec_rate;
>> +        bitrate += st->codec->bit_rate;
>>     
>
> Why aren't you using rc_max_rate ?
>   

I have traced the value, when it is VIDEO, the rc_max_rate is 0.

[...]

>
>   
>>      service->pcr_packet_freq = (ts->mux_rate * PCR_RETRANS_TIME) /
>>          (TS_PACKET_SIZE * 8 * 1000);
>> @@ -536,23 +527,23 @@ static void mpegts_write_pes(AVFormatCon
>>      int val, is_start, len, header_len, write_pcr;
>>      int afc_len, stuffing_len;
>>      int64_t pcr = -1; /* avoid warning */
>>     
>
> Here pcr is int64.
>   

what is wrong with that?

>   
> [...]
>
>   





More information about the FFmpeg-soc mailing list