[Live-devel] i can not mix the h264 and ADTS AAC together to VLC player From EasyDarwin

Ross Finlayson finlayson at live555.com
Sun Feb 10 20:03:44 PST 2019



> On Feb 11, 2019, at 4:00 PM, lijun at ndtv.com.cn wrote:
> 
> I don't get more detail reply , I think  my description is not enough clear,   so after rearrange my word, I submit  it again.
> 
> [1]
> i have implemented a RTSP Server(like proxy server), packetizing the audio and video stream to TS from EasyDarwin
> 
> 
> 
> [2]
> if only have h264 or only have ADTS  AAC stream VLC play is ok.
> 
> 
> 
> [3]
> but mixed h264 and ADTS AAC together, after a few seconds VLC only play video.
> audio packet will be lost, i see it from the VLC [current media information] dialog -> [statistics] tab -> Lost.

Please try (initially) using our “openRTSP” command-line RTSP client <http://www.live555.com/openRTSP/>, instead of VLC.  If you run “openRTSP” on this combined audio+video stream, do you get two (non-zero-sized) files - one for video, one for audio - or only one non-zero-sized file (video)?


> [5]
> my h264 code snippet is  in below
>  void BlockSource::doGetNextFrame()
>  {
>   if (_bFirst)
>   {
>    fFrameSize = MyExchangeBuffer::Inst().readFirstFromVideoBlock(_strBlockName.c_str(), fTo, fMaxSize);
>    _bFirst = false;
>   }
>   else
>   {
>    fFrameSize = MyExchangeBuffer::Inst().readFromVideoBlock(_strBlockName.c_str(), _pBlockChunkPointer, fTo, fMaxSize);
>   }

Note that your “readFromVideoBlock()” function must *not* be blocking.  I.e., if it has no video data to deliver immediately, it must return immediately, rather than waiting for data to come available.  Note that I/O in LIVE555-based applications is *asynchronous* (using a single event loop - rather than multiple threads - to provide concurrency).


> 
>      
>   gettimeofday(&fPresentationTime, NULL);//i dont know how to set it correctly...
>   fDurationInMicroseconds = 1000000 / 22;//i dont know how to dynamic set it, so i set it to 22 fps.

If you are reading from a live video source (rather than from (for example) a pre-recorded video file), you need not set “fDurationInMicroseconds”.  (It will automatically get set to a default value of 0.)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/




More information about the live-devel mailing list