Hi all
I want to transcode a data of pcm to AAC or mp3 from WMV , asf formated
file.
resultly, AAC + x264 with mp4 plays fine.
but dts,pts is bigger more 0 when grabbing first packet.

dts,pts,during-time was exactly right when I tried to decoding with avi,mp4
I don't know why did occur when only using wmv, asf.



//////////////////////
//pcm grabbing
//////////////////////
 int result = 0;
 int audio_out_size  = 0;
 //static uint8_t audio_mute_buffer[AVCODEC_MAX_AUDIO_FRAME_SIZE];
 while(av_read_frame(pMainFormatCtx, &packet)>=0) {
  if(packet.stream_index==videoIndex) {
   Video Deocode
   ////////////////////////////////
   // do something.
   ////////////////////////////////
  }
  else if(packet.stream_index==audioIndex) {
   // short 16bit
   audio_out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
   result =
avcodec_decode_audio3(pAudioCodecCtx,reinterpret_cast<short*>(audiOutbuf.get()),
&audio_out_size, &packet);
   if(audio_out_size > 0)
   {
    
audioEncoder.get()->Process(audiOutbuf.get(),reinterpret_cast<long*>(&audio_out_size));
   }
  }
     av_free_packet(&packet);
 } //while
//DESTROYCODEC:
 av_free(pFrame);
 pFrame = NULL;
 av_free(pFrameConverted);
 pFrameConverted = NULL;



//////////////////////////
first packet

{pts=1579 dts=1579 data=0x03ed1d50 "" ...}

Is it right "0" ?
/////////////////////////


thank you everyone .
have a good time.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to