[Libav-user] C++ send h264/AAC on youtube or wowza

BrokenMo nicolas at twinsview.fr
Sat Jul 6 01:25:03 CEST 2013


Hello everyone,

I have problem for send h264/AAC on youtube or wowza. 
If I save on file, that work, il y send just video or just audio, that work.
But when I send both not.

I think that is PTS/DTS, because I have wowza log.

When that work, just audio or video : 

pts:0>125 || rt:1373046703342>1373046703387
pts:40>125 || rt:1373046703342>1373046703387
pts:80>125 || rt:1373046703343>1373046703387
pts:120>125 || rt:1373046703398>1373046703387
pts:160>245 || rt:1373046703415>1373046703523
pts:200>245 || rt:1373046703477>1373046703523
pts:240>245 || rt:1373046703507>1373046703523
pts:280>245 || rt:1373046703572>1373046703523
pts:320>405 || rt:1373046703597>1373046703697

when I send both :

pts:0>125 || rt:1373040316873>1373040316955
pts:40>125 || rt:1373040316873>1373040316955
pts:80>125 || rt:1373040316944>1373040316955
pts:120>125 || rt:1373040316944>1373040316955
pts:2284>125 || rt:1373040316945>1373040316955
pts:4294965172>2409 || rt:1373040317013>1373040317070
pts:4294967319>4294965297 || rt:1373040317015>1373040317138
pts:4294967319>4294967444 || rt:1373040317021>1373040317140
pts:4294967340>4294967444 || rt:1373040317021>1373040317140

I don't know why pts up like this

my code :

        if (inputNode->outData.stream_index == 0) {
            inputNode->outData.duration =
formatCtx->streams[0]->time_base.den / 25;

            if (inputNode->outData.pts != AV_NOPTS_VALUE)
                inputNode->outData.pts =
av_rescale_q(inputNode->outData.pts, (AVRational){1,25},
formatCtx->streams[0]->time_base);
            if (inputNode->outData.dts != AV_NOPTS_VALUE)
                inputNode->outData.dts =
av_rescale_q(inputNode->outData.dts, (AVRational){1,25},
formatCtx->streams[0]->time_base);

            //inputNode->outData.dts = inputNode->outData.pts =
inputNode->outData.dts * 40;
            std::cerr << inputNode->outData.dts << " " <<
inputNode->outData.duration << " " << inputNode->outData.pts << " video" <<
std::endl;
        } else {
            inputNode->outData.duration =
formatCtx->streams[1]->time_base.den / 25;
            inputNode->outData.pts = inputNode->outData.dts = audioCount;
            audioCount += inputNode->outData.duration;

            std::cerr << inputNode->outData.dts << " " <<
inputNode->outData.duration << " " << inputNode->outData.pts << " audio" <<
std::endl;
        }




        av_write_frame( formatCtx, &(inputNode->outData) ) ;

My log is good :

0 40 0 video
40 40 40 video
80 40 80 video
120 40 120 video
0 40 0 audio
160 40 160 video
40 40 40 audio
200 40 200 video
80 40 80 audio
240 40 240 video
120 40 120 audio
280 40 280 video
160 40 160 audio
320 40 320 video
200 40 200 audio
360 40 360 video
240 40 240 audio
400 40 400 video
280 40 280 audio
440 40 440 video
320 40 320 audio


thank for your help !






--
View this message in context: http://libav-users.943685.n4.nabble.com/C-send-h264-AAC-on-youtube-or-wowza-tp4658096.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list