Discussion:
[Live-devel] Audio + Video streaming in sync using Live555
Dhrupal Tilava
2018-10-16 11:33:48 UTC
Permalink
Dear Team,

we are using *testOnDemandRTSPServer.cpp *for the Live Video streaming.
So, in the input I am giving H.264 Encoded fifo to the compile binary using
this testOnDemandRTSPServer.cpp and I am getting RTSP URL for the Video
streaming.
This is working fine.

Now,we want to add the Audio with Video in the Live streaming. For the
Audio I have one AAC-LC Encoded fifo.
But to stream Audio and Video fifo in time sync, I am not able to find any
option in the testOnDemarRTSPServer.cpp file.

It would be really helpful if you can provide any example/reference in
which, I give the Audio fifo and video fifo as input and then I get the URL
for the streaming.
So, I can do the audio and video streaming smoothly.

Note: we have separate fifo for the Audio and Video.

Thank you so much in advance for your kind support.

*With Best Regards,*
Dhrupal Tilava
VVDN Technologies Pvt. Ltd
Cell : +91 9428158863 | Skype : dhrupal.tilava_1
Ross Finlayson
2018-10-16 13:01:22 UTC
Permalink
we are using testOnDemandRTSPServer.cpp for the Live Video streaming.
So, in the input I am giving H.264 Encoded fifo to the compile binary using this testOnDemandRTSPServer.cpp and I am getting RTSP URL for the Video streaming.
This is working fine.
Now,we want to add the Audio with Video in the Live streaming. For the Audio I have one AAC-LC Encoded fifo.
But to stream Audio and Video fifo in time sync, I am not able to find any option in the testOnDemarRTSPServer.cpp file.
It would be really helpful if you can provide any example/reference in which, I give the Audio fifo and video fifo as input and then I get the URL for the streaming.
So, I can do the audio and video streaming smoothly.
Streaming audio+video is easy: Just call “addSubsession()” twice - once for the video source, another time for the audio source. (So that your “ServerMediaSession” object contains two “ServerMediaSubsession” objects - one for the video, one for the audio.)

However, for audio/video synchronization to work properly, each source (video and audio) *must* generate proper “fPresentationTime” values for each frame, and these *must* be aligned with ‘wall clock’ time - i.e., the same time that you’d get if you called “gettimeofday()”.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
Dhrupal Tilava
2018-10-17 13:56:58 UTC
Permalink
Dear Ross Finlayson,

Thanks for your quick response.

We have done the changes according to your response.
After this changes, we are able to do Audio+Video streaming but we are
getting Audio+Video in sync only for one minute.
After that we are not getting Audio+video in sync.

Below is the code changes we have done in the testOnDemandRTSPServer.cpp.

1. {
char const* streamName = "AudioVideoTest";
char const* inputFileName = "/data/misc/qmmf/test_track_1_1920x1080.h264";
char const* inputFileNameAud = "/data/misc/qmmf/recorder_fifo_audio.aac";
ServerMediaSession* sms = ServerMediaSession::createNew(*env, streamName,
streamName, descriptionString);
sms->addSubsession(ADTSAudioFileServerMediaSubsession ::createNew(*env,
inputFileNameAud, reuseFirstSource));
sms->addSubsession(H264VideoFileServerMediaSubsession ::createNew(*env,
inputFileName, reuseFirstSource));
rtspServer->addServerMediaSession(sms);
announceStream(rtspServer, sms, streamName, inputFileName);
}

2. We have to make the changes in the ADTSAudioFileSource.cpp to read the
AAC-LC Header as we are getting the error
while streaming the AAC-LC Fifo with the H.264 Encoded Video Fifo. (I have
attached this file for your reference)

But, Now issue is we are not able to get the Audio/Video in sync for more
then one minute.

Please provide your valuable suggestions to resolve this issue.

*With Best Regards,*
Dhrupal Tilava
VVDN Technologies Pvt. Ltd
Cell : +91 9428158863 | Skype : dhrupal.tilava_1
Send live-devel mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.live555.com/mailman/listinfo/live-devel
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of live-devel digest..."
1. Audio + Video streaming in sync using Live555 (Dhrupal Tilava)
2. Re: Audio + Video streaming in sync using Live555 (Ross Finlayson)
----------------------------------------------------------------------
Message: 1
Date: Tue, 16 Oct 2018 17:03:48 +0530
Subject: [Live-devel] Audio + Video streaming in sync using Live555
<
Content-Type: text/plain; charset="utf-8"
Dear Team,
we are using *testOnDemandRTSPServer.cpp *for the Live Video streaming.
So, in the input I am giving H.264 Encoded fifo to the compile binary using
this testOnDemandRTSPServer.cpp and I am getting RTSP URL for the Video
streaming.
This is working fine.
Now,we want to add the Audio with Video in the Live streaming. For the
Audio I have one AAC-LC Encoded fifo.
But to stream Audio and Video fifo in time sync, I am not able to find any
option in the testOnDemarRTSPServer.cpp file.
It would be really helpful if you can provide any example/reference in
which, I give the Audio fifo and video fifo as input and then I get the URL
for the streaming.
So, I can do the audio and video streaming smoothly.
Note: we have separate fifo for the Audio and Video.
Thank you so much in advance for your kind support.
*With Best Regards,*
Dhrupal Tilava
VVDN Technologies Pvt. Ltd
Cell : +91 9428158863 | Skype : dhrupal.tilava_1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <
http://lists.live555.com/pipermail/live-devel/attachments/20181016/a5539bda/attachment-0001.html
------------------------------
Message: 2
Date: Tue, 16 Oct 2018 06:01:22 -0700
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] Audio + Video streaming in sync using
Live555
Content-Type: text/plain; charset=utf-8
we are using testOnDemandRTSPServer.cpp for the Live Video streaming.
So, in the input I am giving H.264 Encoded fifo to the compile binary
using this testOnDemandRTSPServer.cpp and I am getting RTSP URL for the
Video streaming.
This is working fine.
Now,we want to add the Audio with Video in the Live streaming. For the
Audio I have one AAC-LC Encoded fifo.
But to stream Audio and Video fifo in time sync, I am not able to find
any option in the testOnDemarRTSPServer.cpp file.
It would be really helpful if you can provide any example/reference in
which, I give the Audio fifo and video fifo as input and then I get the URL
for the streaming.
So, I can do the audio and video streaming smoothly.
Streaming audio+video is easy: Just call ?addSubsession()? twice - once
for the video source, another time for the audio source. (So that your
?ServerMediaSession? object contains two ?ServerMediaSubsession? objects -
one for the video, one for the audio.)
However, for audio/video synchronization to work properly, each source
(video and audio) *must* generate proper ?fPresentationTime? values for
each frame, and these *must* be aligned with ?wall clock? time - i.e., the
same time that you?d get if you called ?gettimeofday()?.
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
------------------------------
Subject: Digest Footer
_______________________________________________
live-devel mailing list
http://lists.live555.com/mailman/listinfo/live-devel
------------------------------
End of live-devel Digest, Vol 179, Issue 4
******************************************
Loading...