Rafael Lorenzo Alonso | 1 Apr 2011 12:50
Picon

H264VideoFileServerMediaSubsession and doEventLoop

Hi,

First of all, congratulations for such a great library.

We're working on a RTSPServer of H264 video from several RTP flows using 
your library. We're facing some problems most of them we have found 
solutions for but we have one we think is specially difficult for us to 
resolve without some help.

In particular, the problem concerns the function getAuxSDPLine. In the 
following line: envir().taskScheduler().doEventLoop(&fDoneFlag);

char const* H264VideoFileServerMediaSubsession::getAuxSDPLine(RTPSink* 
rtpSink, FramedSource* inputSource) {
    // Note: For H264 video files, the 'config' information 
("profile-level-id" and "sprop-parameter-sets") isn't known
    // until we start reading the file.  This means that "rtpSink"s 
"auxSDPLine()" will be NULL initially,
    // and we need to start reading data from our file until this changes.
    fDummyRTPSink = rtpSink;

    // Start reading the file:
    fDummyRTPSink->startPlaying(*inputSource, afterPlayingDummy, this);

    // Check whether the sink's 'auxSDPLine()' is ready:
    checkForAuxSDPLine(this);

    envir().taskScheduler().doEventLoop(&fDoneFlag);

    char const* auxSDPLine = fDummyRTPSink->auxSDPLine();
(Continue reading)

Matias Hernandez Arellano | 1 Apr 2011 20:03
Picon
Favicon

Stream my own manipulated image array (push data to stream)

(sorry for my poor english)..

I hope i'm writing to right list..

I have an application  to do some image processing created with OpenCV (to capture frames from a camera and
manipulate the images) .. now i need to add a streaming capability (the idea is see the result of the
processing part in other machine, maybe through HTML5) .. So i made a little research about this, and found
i can use different protocols to do that and i think to use this library to take care of that..

Then i try to found a good tool/lib to accomplish my task. .. i try with gstreamer, they have an API called
AppSrc to push data into a buffer (in this case the frames getting with OpenCV) and stream that, but i have
some troubles to join their Glib Loop with the application, so i think in libvlc and finally found live555 ,
but i can't find any example of how can i do the stream part with frames externally created ... ..

So. It's possible to use live555 to stream this content??
Any guideline, idea or example about this?

PD: I get the frames and i can convert to any format (one-by-one but is really quick) .. so i just need to push
into "the stream" to send over networks and can see in other device "live streaming" ..

Thanks in advance.
Matías Hernandez Arellano
Ingeniero de Software/Proyectos en VisionLabs S.A
CDA Archlinux-CL
www.msdark.archlinux.cl
Rafael Lorenzo Alonso | 5 Apr 2011 12:46
Picon

There is a leak in BasicTaskScheduler

Hi,

You should call unscheduleDelayedTask in the destructor of 
BasicTaskScheduler... (BasicTaskScheduler.cpp)

Greetings,
Rafael Lorenzo,
Infrastructure Software Engineer.
SEPSA SCI, Albatros Corporation.
Cristiano Belloni | 6 Apr 2011 12:04
Favicon

Synchro problem and isCurrentlyAwaitingData()

Hi to all,
I wrote a custom shared memory source. it inherits from FramedSource.
The shared memory is synchronized via Linux semaphores (simple producer-consumer algorithm), but since I didn't want to subclass TaskScheduler, I still use a "dummy" file descriptor-based communication with live555. In pseudocode:


~~~Client (without live555):

wait on semaphore_empty (blocking)
copy frame in shared memory
write one byte in a dedicated FIFO (this should wake up live555' TaskScheduler select())
post on semaphore_fill

~~~Server (with live555, in SharedMemSource::incomingPacketHandler1())
[turnOnBackgroundReadHandling is called in doGetNextFrame]

wait on semaphore_fill (blocking)
read one byte from the dedicated FIFO (to flush the FIFO buffer)
copy frame from shared memory
post on semaphore_empty

This works. Altought the blocking wait on semaphore_fill might make you wonder, the client wakes up my source with the write() in the dedicated FIFO and immediately posts on semaphore_fill, so the server almost never waits, and if it does, it doesn't block for a really small time.

The problem is that, after a while (1 or 2 hours usually), the client does its cycle and the server never wakes up. It *doesn't* get stuck on the wait, I checked: it simply never wakes up, as if the client write() was lost (but it *always* succeed on the client side) or the select() didn't wake up even if the write succeeded.

I would like to emphasize this: the server *never* gets stuck forever on its wait. When it gets stuck, the client is one frame ahead of the server, incomingPacketHandler1() simply is never called anymore and the wait is not even reached.

At this point, I have two questions:

1) In your knowledge, can the select() not wake up even if a write() on the other side succeeded? If it can, how is it possible? Note that the system is an embedded ARM processor, and it could get quite busy while acquiring and streaming video.

2) First thing I do in SharedMemSource::incomingPacketHandler1() is to check for isCurrentlyAwaitingData(). If it's false, I simply return before doing all the cycle, and this happens quite often. What's the meaning of isCurrentlyAwaitingData()? I mean, if the select() in TaskScheduler returned, some data must be present on the file/fifo/socket. How is it possible that the select() did return but still there's no data available? I'm getting really confused on this.

Thanks and regards,
Cristiano Belloni.


_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Cristiano Belloni | 6 Apr 2011 18:49
Favicon

Re: Synchro problem and isCurrentlyAwaitingData()

Il 06/04/2011 12:04, Cristiano Belloni ha scritto:
Hi to all,
I wrote a custom shared memory source. it inherits from FramedSource.
The shared memory is synchronized via Linux semaphores (simple producer-consumer algorithm), but since I didn't want to subclass TaskScheduler, I still use a "dummy" file descriptor-based communication with live555. In pseudocode:


~~~Client (without live555):

wait on semaphore_empty (blocking)
copy frame in shared memory
write one byte in a dedicated FIFO (this should wake up live555' TaskScheduler select())
post on semaphore_fill

~~~Server (with live555, in SharedMemSource::incomingPacketHandler1())
[turnOnBackgroundReadHandling is called in doGetNextFrame]

wait on semaphore_fill (blocking)
read one byte from the dedicated FIFO (to flush the FIFO buffer)
copy frame from shared memory
post on semaphore_empty

This works. Altought the blocking wait on semaphore_fill might make you wonder, the client wakes up my source with the write() in the dedicated FIFO and immediately posts on semaphore_fill, so the server almost never waits, and if it does, it doesn't block for a really small time.

The problem is that, after a while (1 or 2 hours usually), the client does its cycle and the server never wakes up. It *doesn't* get stuck on the wait, I checked: it simply never wakes up, as if the client write() was lost (but it *always* succeed on the client side) or the select() didn't wake up even if the write succeeded.

I would like to emphasize this: the server *never* gets stuck forever on its wait. When it gets stuck, the client is one frame ahead of the server, incomingPacketHandler1() simply is never called anymore and the wait is not even reached.

At this point, I have two questions:

1) In your knowledge, can the select() not wake up even if a write() on the other side succeeded? If it can, how is it possible? Note that the system is an embedded ARM processor, and it could get quite busy while acquiring and streaming video.

2) First thing I do in SharedMemSource::incomingPacketHandler1() is to check for isCurrentlyAwaitingData(). If it's false, I simply return before doing all the cycle, and this happens quite often. What's the meaning of isCurrentlyAwaitingData()? I mean, if the select() in TaskScheduler returned, some data must be present on the file/fifo/socket. How is it possible that the select() did return but still there's no data available? I'm getting really confused on this.

Thanks and regards,
Cristiano Belloni.


_______________________________________________ live-devel mailing list live-devel-cunTk1MwBs/NLCcxxxaBvgC/G2K4zDHf@public.gmane.org http://lists.live555.com/mailman/listinfo/live-devel

Update: I put some logs in BasicTaskScheduler to see what happens.

one before the select():

printf ("[SYNCHROBUG] About to do the select, timeout %d.%d\n", tv_timeToDelay.tv_sec, tv_timeToDelay.tv_usec);
    int selectResult = select(fMaxNumSockets, &readSet, &writeSet, &exceptionSet, &tv_timeToDelay);
    if (selectResult < 0) {
[...]

two after the select(), (one catches an EINTR or EAGAIN  error value should they happen):

#else
    if (errno != EINTR && errno != EAGAIN) {
#endif
        // Unexpected error - treat this as fatal:
#if !defined(_WIN32_WCE)
        perror("BasicTaskScheduler::SingleStep(): select() fails");
#endif
        internalError();
      }
  }
    if (errno == EINTR || errno == EAGAIN) {
       perror ("[SYNCHROBUG] error is");
    }

  printf ("[SYNCHROBUG] Select done, getting sockets\n");
[...]

two after the first and second pass of readable socket check:

 int resultConditionSet = 0;
    if (FD_ISSET(sock, &readSet) && FD_ISSET(sock, &fReadSet)/*sanity check*/) {
       printf ("[SYNCHROBUG] Socket %d found readable on first pass\n", sock);
       resultConditionSet |= SOCKET_READABLE;
    }

    [...]

      if (FD_ISSET(sock, &readSet) && FD_ISSET(sock, &fReadSet)/*sanity check*/) {
         printf ("[SYNCHROBUG] Socket %d found readable on second pass\n", sock);
         resultConditionSet |= SOCKET_READABLE;
      }

And one to check if we found some readable/writable/excepting socket at all:


if (handler == NULL) {
       fLastHandledSocketNum = -1;//because we didn't call a handler
       printf ("[SYNCHROBUG] No socket found at all\n");
    }


at first everything is ok:

[SYNCHROBUG] About to do the select, timeout 0.0
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] No socket found at all
[SYNCHROBUG] About to do the select, timeout 0.0
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] About to do the select, timeout 0.0
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 5 found readable on first pass
[SYNCHROBUG] About to do the select, timeout 0.0
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 5 found readable on second pass
[SYNCHROBUG] About to do the select, timeout 0.0
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 5 found readable on second pass
[SYNCHROBUG] About to do the select, timeout 0.0
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 5 found readable on second pass
[SYNCHROBUG] About to do the select, timeout 0.0
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 5 found readable on second pass
[SYNCHROBUG] About to do the select, timeout 0.0
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 5 found readable on second pass

(socket 5 must be the FIFO, I guess)


But then, select keeps randomly return errno=11, aka EAGAIN or "Resource temporarily unavailable":

[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 5 found readable on second pass
[SYNCHROBUG] About to do the select, timeout 1.480311
[SYNCHROBUG] error is: Resource temporarily unavailable
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 6 found readable on first pass
[SYNCHROBUG] About to do the select, timeout 1.479309
[SYNCHROBUG] error is: Resource temporarily unavailable
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 5 found readable on second pass
[SYNCHROBUG] About to do the select, timeout 1.478362
[SYNCHROBUG] error is: Resource temporarily unavailable
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 6 found readable on first pass
[SYNCHROBUG] About to do the select, timeout 1.477358
[SYNCHROBUG] error is: Resource temporarily unavailable
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 5 found readable on second pass
[SYNCHROBUG] About to do the select, timeout 1.476431
[SYNCHROBUG] error is: Resource temporarily unavailable
[SYNCHROBUG] Select done, getting sockets
[SYNCHROBUG] Socket 6 found readable on first pass

Now, I don't even know the reason why a select() could return EAGAIN (a lot of people say it souldn't at all, and even my "man 3 select" agrees: http://stackoverflow.com/questions/4193043/select-on-a-pipe-in-blocking-mode-returns-eagain ), but I see this case is handled in your code and ignored, just like the EINTR case:

    if (errno != EINTR && errno != EAGAIN) {
#endif
        // Unexpected error - treat this as fatal:
#if !defined(_WIN32_WCE)
        perror("BasicTaskScheduler::SingleStep(): select() fails");
#endif
        internalError();
      }

[if errno is EINTR or EAGAIN, then the scheduler goes on inspecting the select()'s returned sets].

Could that be the origin of my problems?

As obviously you can't try my executables on my hardware, please tell me what else could I log. BTW the rtsp/rtp client in this picture is openRTSP. Here's an ascii schema :)

client program generating frames ----FIFO---> rtsp server based on live555 ----RTSP/RTP/TCP----> openRTSP

Thank you and best regards,

Cristiano Belloni.


_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Favicon

locally viewing the stream generated by testMPEG1or2AudioVideoStreamer in unicast mode

Hi Ross,

I have been successfully able to run testMPEG1or2AudioVideoStreamer in unicast mode, by making suggested changes as per the FAQ.

Thanks a lot for those suggestions.

But I am not able to play the streaming locally on my localhost (I have tried giving the destinationAddressStr as “127.0.0.1” or the local ip address as output from the ipconfig command).

I am using VLC Player to view the streaming video.

If you could please provide me some pointers/suggestions for the reason of this failure.

 

Regards,

Sumeet


::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------
_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Ritun Palit | 7 Apr 2011 13:23
Favicon

problem in playing testH264VideoStreamer with vlc

Hi Ross,

 

I’m executing the testH264VideoStreamer.exe with sample test.264 (downloaded from live555) and facing a weird problem. When I try to play the “rtsp:// url”  from VLC 1.1.8 (latest version of vlc) player, it starts flickering after finishing of 1st time play call.  I had tried the “url” with openrtsp, it is generating video-H264-1 file and size of the file is not zero.

 

If you could please provide me your valuable suggestion to point out the problem .

 

Thanks & Regards,

Ritun


::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------
_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Manuel | 7 Apr 2011 23:49

Publish two streams (one without audio) from a camera

Hi, I'm trying to get the audio and video stream from a camera using RTSPClient and then publish a stream with audio and video and another stream with video only.


This is what I have:

I create a RTSPServer
I create two ServerMediaSession, sms_with_audio and sms_without_audio
RTSPClient connects to camera
I get the SDP
I build a MediaSession from the sdp
I iterate the subsessions, calling ServerMediaSession::addSubsession() for the video subsession on sms_with_audio and sms_without_audio and for the audio subsession on sms_with_audio
Then I add the SMSs to the RTSPServer
Call RTSPClient::playMediaSession
and finally start the event loop

My problem is that if I try to play the stream without audio, it freezes after a few seconds.

What could I be missing?

Thanks in advance,

Manuel


_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Favicon

Streaming testMPEG1or2AudioVideoStreamer behind network firewall

Hi Ross,

We have setup a Windows server (with a publically accessible IP address) outside our LAN. When I setup and run “live555MediaServer.exe” on this server, and try to access (using VLC Player) the generated RTSP URL from my local machine (which resides behind a network firewall), I am able to see the stream.

However when I try to do the same, using “testMPEG1or2AudioVideoStreamer.exe”, I am unable to view the stream from my local machine (which resides behind a network firewall). I have even tried to run testMPEG1or2AudioVideoStreamer.exe in unicast mode (as suggested by the FAQ), still no success. Any suggestions/guidance for the reason for this difference in behavior will be very helpful.

 

Regards,

Sumeet


::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------
_______________________________________________
live-devel mailing list
live-devel@...
http://lists.live555.com/mailman/listinfo/live-devel
Abbas Javadtalab | 11 Apr 2011 08:55
Picon
Favicon

How To codify the testH264videoStreamer Program in order to transmit NAL units?

Hello,
I am trying to modify the "testH264VideoStreamer" program in order to 
get NAL unit instead of using file.
I have developed an user interface to work with x264 library. the UI is 
able to encode each frame and generate NAL nits using x264 library. Now, 
I want to integrate this UI with "testH264VideoStreamer" program.
I have some question:
1-How can I pass the NAL unit to this program directly?
2-Is there any function that get the NAL units directly?
3- Is there any live chat similar to x264 developer group to ask 
questions online?
Any help is appropriated.
Thanks in advance.
Abbas

Gmane