[Live-devel] Ignoring SIGPIPE

Philippe Clavel philippe at rabbit.tv
Fri Apr 20 08:53:38 PDT 2012


Hi,
First I am not sure the right way to reply only to my message...
Let me know how to do it right for next time ;)
Regarding the proposed change it work for me.
Just one comment you may want to do something like that only
> #ifdef USE_SIGNALS
>      // Ignore the SIGPIPE signal, so that clients on the same host that are killed
>      // don't also kill us:
>    #ifdef SO_NOSIGPIPE
>        int set_option = 1;
>    setsockopt(ourSocket, SOL_SOCKET, SO_NOSIGPIPE, &set_option, sizeof set_option);
>    #endif
>    #endif

As the other portion of the code should be needed to be done only
ounce at start of the app (and not everytime we create a socket).
But that work just fine ;)
Thanks!

Philippe

On Apr 20, 2012, at 12:08 AM, "live-devel-request at ns.live555.com"
<live-devel-request at ns.live555.com> wrote:

> Send live-devel mailing list submissions to
>    live-devel at lists.live555.com
>
> 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
>    live-devel-request at lists.live555.com
>
> You can reach the person managing the list at
>    live-devel-owner at lists.live555.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of live-devel digest..."
>
>
> Today's Topics:
>
>   1. Questions on MPEG2 Transport Stream (Felix Radensky)
>   2. Re: Ignoring SIGPIPE (Ross Finlayson)
>   3. Re: Questions on MPEG2 Transport Stream (Ross Finlayson)
>   4. Live555 Library build for IOS 5.1 (krishnaks at iwavesystems.com)
>   5. MJPEG -> MKV (Tomasz Ku?ma)
>   6. Re: MJPEG -> MKV (Ross Finlayson)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 19 Apr 2012 19:16:48 +0300
> From: Felix Radensky <felix at embedded-sol.com>
> To: live-devel at ns.live555.com
> Subject: [Live-devel] Questions on MPEG2 Transport Stream
> Message-ID: <4F903A70.6090707 at embedded-sol.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> I have a requirement to stream H.264 video coming from hardware encoder,
> audio (unknown format at the moment) and metadata (unknown format) all
> wrapped as MPEG-2 TS. Video and audio streams should be converted to PES
> before streaming.
>
> By looking at live555 code and documentation I can see that converting
> PES to
> TS and streaming of TS are supported, and multiplexing video and audio
> in TS
> is supported as  well. What I'm missing is the code to convert ES to
> PES and
> streaming of metadata as part of TS. Is that supported as well ? If
> not can you
> please explain how can I add missing features.
>
> Thanks a lot.
>
> Felix.
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 20 Apr 2012 11:14:39 +1000
> From: Ross Finlayson <finlayson at live555.com>
> To: LIVE555 Streaming Media - development & use
>    <live-devel at ns.live555.com>
> Subject: Re: [Live-devel] Ignoring SIGPIPE
> Message-ID: <1C55F47E-B68E-48D8-8643-F55C70AF49F4 at live555.com>
> Content-Type: text/plain; charset="us-ascii"
>
>> I have an issue on Mac OSX where the RTSPClient was throwing SIG_PIPE whenever the TCP connection from the server was terminated (server timeout or crash).
>> Trying to USE_SIGNALS as below did not work and we were still crashing when the connection was dropping:
>> #ifdef USE_SIGNALS
>>  // Ignore the SIGPIPE signal, so that clients on the same host that are killed
>>  // don't also kill us:
>>  signal(SIGPIPE, SIG_IGN);
>> #endif
>>
>> The only way we found to fix ti was to set SO_NOSIGPIPE on the socket itself when created.
>>
>>
>>  if (newSocket > 0) {
>>    int set_option = 1;
>>    if (0 == setsockopt(newSocket, SOL_SOCKET, SO_NOSIGPIPE, &set_option, sizeof(set_option))) {
>>    } else {
>>        socketErr(env,"failed to set socket signal option");
>>    }
>>  }
>>
>> I have attached the source code with the change in GroupsockHelper.cpp .
>> Will it be possible to include that change in an upcoming release?
>
> No, because I don't want this behavior (ignoring SIGPIPE signals) to happen all the time.  Instead, it should happen only when the developer specifically wants it.
>
> In this case, what we want is for the RTSP server to ignore SIGPIPE signals that might get sent when clients (running on the same host) die.  So the right place to do this is in the "RTSPServer" code, in the same place where we currently do:
>    #ifdef USE_SIGNALS
>      // Ignore the SIGPIPE signal, so that clients on the same host that are killed
>      // don't also kill us:
>      signal(SIGPIPE, SIG_IGN);
>    #endif
>
> What I might end up doing, therefore, is replace this code with:
>    #ifdef USE_SIGNALS
>      // Ignore the SIGPIPE signal, so that clients on the same host that are killed
>      // don't also kill us:
>    #ifdef SO_NOSIGPIPE
>        int set_option = 1;
>    setsockopt(ourSocket, SOL_SOCKET, SO_NOSIGPIPE, &set_option, sizeof set_option);
>    #else
>      signal(SIGPIPE, SIG_IGN);
>    #endif
>    #endif
>
> I hope this will work for you...
>
>
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120420/4b695d8b/attachment-0001.html>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 20 Apr 2012 11:22:18 +1000
> From: Ross Finlayson <finlayson at live555.com>
> To: LIVE555 Streaming Media - development & use
>    <live-devel at ns.live555.com>
> Subject: Re: [Live-devel] Questions on MPEG2 Transport Stream
> Message-ID: <53928BC7-D1B8-43C6-9470-19334D8614CB at live555.com>
> Content-Type: text/plain; charset="us-ascii"
>
>> By looking at live555 code and documentation I can see that converting PES to
>> TS and streaming of TS are supported, and multiplexing video and audio in TS
>> is supported as  well. What I'm missing is the code to convert ES to PES and
>> streaming of metadata as part of TS. Is that supported as well ?
>
> We also have code that will convert (video or audio) Elementary Streams to Transport Streams: the "MPEG2TransportStreamFromESSource" class.
>
> However, we don't have code for converting 'metadata' to Transport Streams.  However, you should be able to do this yourself, by implementing your own subclass of "MPEG2TransportStreamMultiplexor".  (Note that the two existing classes - "MPEG2TransportStreamFromESSource" and "MPEG2TransportStreamFromPESSource" - are also subclasses of "MPEG2TransportStreamMultiplexor".)
>
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120420/34c564f1/attachment-0001.html>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 20 Apr 2012 10:47:01 +0530
> From: krishnaks at iwavesystems.com
> To: live-devel at ns.live555.com
> Subject: [Live-devel] Live555 Library build for IOS 5.1
> Message-ID:
>    <029cd7f97da275403f918c9d0ed7f340.squirrel at 124.124.219.233>
> Content-Type: text/plain; charset="iso-8859-1"
>
>
>
>
>
> Hi,
>
> I m trying to build Live 555 for IOS 5.1
> I have updated config.iphoneos file for IOS 5.1.(config.iphoneos attached)
> But I am getting following make error
>
>
> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-llvm-g++-4.2
> -c -Iinclude -I../UsageEnvironment/include -I../groupsock/include -I.
> -DBSD=1 -O2 -DSOCKLEN_T=socklen_t -DHAVE_SOCKADDR_LEN=1
> -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fPIC -arch armv7
> --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
> -Wall  Media.cpp
> cc1plus: error: unrecognized command line option "-arch"
> make[1]: *** [Media.o] Error 1
> make: *** [all] Error 2
>
>
> What may be the issue?
>
> Thanks in advance
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: config.iphoneos
> Type: application/octet-stream
> Size: 1229 bytes
> Desc: not available
> URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120420/2fda5233/attachment-0001.obj>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 19 Apr 2012 11:39:26 +0200
> From: Tomasz Ku?ma <mapedd at gmail.com>
> To: "live-devel at ns.live555.com" <live-devel at ns.live555.com>
> Subject: [Live-devel] MJPEG -> MKV
> Message-ID: <683FF2B4-3B62-45E9-AD3F-468E6BE00808 at gmail.com>
> Content-Type: text/plain;    charset=utf-8
>
> Hi
>
>
>
> i've just started my journey with Live555 library and my first task is quite hard :)
>
> I've got RSTP incoming stream with video in MJPEG format in it.
>
> My job is to save this stream to disk as a mkv file. As far as i know to save some video file to MKV container i can use mkvmerge tool from mkvtoolnix. But the problem here is how to save MJPEG video stream to something compatible with matroska ...
>
> Does live555 have built in support to do such a thing? Does saving it as a MPEG4 will do the job? Does any of the testPrograms from live555 source can do that?
>
> Thanks for any help guys!
>
> Pozdrawiam
> Tomek Ku?ma
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 20 Apr 2012 16:35:55 +1000
> From: Ross Finlayson <finlayson at live555.com>
> To: LIVE555 Streaming Media - development & use
>    <live-devel at ns.live555.com>
> Subject: Re: [Live-devel] MJPEG -> MKV
> Message-ID: <DCB664B4-32BA-4124-A550-75AE2E9A6BD1 at live555.com>
> Content-Type: text/plain; charset="us-ascii"
>
>> My job is to save this stream to disk as a mkv file. As far as i know to save some video file to MKV container i can use mkvmerge tool from mkvtoolnix. But the problem here is how to save MJPEG video stream to something compatible with matroska ...
>>
>> Does live555 have built in support to do such a thing?
>
> Sorry, no.  There's currently no support in the library for writing a Matroska file (only for streaming from (i.e., reading from) such files).
>
>
>> Does saving it as a MPEG4 will do the job?
>
> No (because a "MPEG4" file is not a Matroska file).
>
>
>> Does any of the testPrograms from live555 source can do that?
>
> No.
>
>
> Ross Finlayson
> Live Networks, Inc.
> http://www.live555.com/
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120420/e5dd2563/attachment.html>
>
> ------------------------------
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
>
>
> End of live-devel Digest, Vol 102, Issue 22
> *******************************************



More information about the live-devel mailing list