[Live-devel] Mpeg Audio missing or corrupted in MPEG-2 Transport Stream or seperate sreams

Eric Pheatt eric.pheatt at gmail.com
Mon Jan 28 17:29:43 PST 2008


On Dec 17, 2007 6:11 PM, Ross Finlayson <finlayson at live555.com> wrote:
> >And with ulaw all I get is static.
>
> Interesting....
>
>
> >Could this be an endian issue with the audio encoders that are
> >currently being used?
> >
> >Im running this on a KuroHG PowerPC
>
> Interesting.  Byte ordering could well be the problem.  The
> "wis-streamer" code assumes that the input (16-bit PCM) audio samples
> have the same byte order as the computer host.  PowerPC is big-endian
> (at least by default).  Is it possible that your audio PCM input
> source is, instead, little-endian?  If so, can you change this?
>

I had to rebuild my machine after the drive decided it was exactly 360
days old.. so I am looking at this issue again.

I made some modifications in an effort to address a potential endian
issue but I don't seem to be radically closer.

In Options.hh
I changed
#define PCM_AUDIO_IS_LITTLE_ENDIAN 1
to
#define PCM_AUDIO_IS_LITTLE_ENDIAN 0

WISInput.cpp
In WISInput::openFiles
I changed
      if (sscanf(line, "%d: [%u-%*u]: digital audio\n", &m, &n) != 2) continue;
to
      char *c;
      if ((c = strrchr(line, ':')) == NULL ||
          strcmp(c, ": digital audio\n") ||
          sscanf(line, "%d: [%u-%*u]:", &m, &n) != 2)
            continue;
      //if (sscanf(line, "%d: [%u-%*u]: digital audio\n", &m, &n) !=
2) continue;

In WISInput::initALSA
changed AFMT_S16_LE to AFMT_S16_BE

Which results in ulaw and pcm in seperate streams working for me in
VLC but in order for this to work with the MythTV FreeBox recorder I
need to have the output in a single transport stream..

Where should I look to figure out what I need to do to possibly stream
mpeg2 video and pcm audio in a transport stream? Has anyone else  used
the live555 libraries to do this before?

Thanks,
Eric

P.S. I've included below the stream info from openRTSP for each of the
options if that helps to better point to the issue.

mythtv at KUROHG:/myth/src/wis-streamer$ wis-streamer -i 2 -c
ntsc-cable:57 -t ntsc -p 8554 -w 640 -h 480 -mpeg2 -r 1500000
-mpegtransport 128 -D "ComedyP"

mythtv at mythtv:~$ openRTSP rtsp://192.168.0.2:8554/ > test.out
Opened URL "rtsp://192.168.0.2:8554/", returning a SDP description:
v=0
o=- 1201566180637825 1 IN IP4 192.168.0.2
s=ComedyP
i=LIVE555 Streaming Media v
t=0 0
a=tool:LIVE555 Streaming Media v2008.01.18
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:ComedyP
a=x-qt-text-inf:LIVE555 Streaming Media v
m=video 0 RTP/AVP 33
c=IN IP4 0.0.0.0
a=control:track1


mythtv at KUROHG:/myth/src/wis-streamer$ wis-streamer -i 2 -c
ntsc-cable:57 -t ntsc -p 8554 -w 640 -h 480 -mpeg2 -r 1500000 -aac 128
-D "ComedyP"

mythtv at mythtv:~$ openRTSP rtsp://192.168.0.2:8554/ > test.out
Opened URL "rtsp://192.168.0.2:8554/", returning a SDP description:
v=0
o=- 1201566265830191 1 IN IP4 192.168.0.2
s=ComedyP
i=LIVE555 Streaming Media v
t=0 0
a=tool:LIVE555 Streaming Media v2008.01.18
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:ComedyP
a=x-qt-text-inf:LIVE555 Streaming Media v
m=video 0 RTP/AVP 32
c=IN IP4 0.0.0.0
a=control:track1
m=audio 0 RTP/AVP 97
c=IN IP4 0.0.0.0
a=rtpmap:97 MPEG4-GENERIC/48000/2
a=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1210
a=control:track2


mythtv at KUROHG:/myth/src/wis-streamer$ wis-streamer -i 2 -c
ntsc-cable:57 -t ntsc -p 8554 -w 640 -h 480 -mpeg2 -r 1500000
-mpegaudio 128 -D "ComedyP"

mythtv at mythtv:~$ openRTSP rtsp://192.168.0.2:8554/ > test.out
Opened URL "rtsp://192.168.0.2:8554/", returning a SDP description:
v=0
o=- 1201567443772063 1 IN IP4 192.168.0.2
s=ComedyP
i=LIVE555 Streaming Media v
t=0 0
a=tool:LIVE555 Streaming Media v2008.01.18
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:ComedyP
a=x-qt-text-inf:LIVE555 Streaming Media v
m=video 0 RTP/AVP 32
c=IN IP4 0.0.0.0
a=control:track1
m=audio 0 RTP/AVP 14
c=IN IP4 0.0.0.0
a=control:track2

mythtv at KUROHG:/myth/src/wis-streamer$ wis-streamer -i 2 -c
ntsc-cable:57 -t ntsc -p 8554 -w 640 -h 480 -mpeg2 -r 1500000 -amr 128
-D "ComedyP"

mythtv at mythtv:~$ openRTSP rtsp://192.168.0.2:8554/ > test.out
Opened URL "rtsp://192.168.0.2:8554/", returning a SDP description:
v=0
o=- 1201567499687864 1 IN IP4 192.168.0.2
s=ComedyP
i=LIVE555 Streaming Media v
t=0 0
a=tool:LIVE555 Streaming Media v2008.01.18
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:ComedyP
a=x-qt-text-inf:LIVE555 Streaming Media v
m=video 0 RTP/AVP 32
c=IN IP4 0.0.0.0
a=control:track1
m=audio 0 RTP/AVP 97
c=IN IP4 0.0.0.0
a=rtpmap:97 AMR/8000
a=fmtp:97 octet-align=1
a=control:track2


Both of the following work just fine now.


mythtv at KUROHG:/myth/src/wis-streamer$ wis-streamer -i 2 -c
ntsc-cable:57 -t ntsc -p 8554 -w 640 -h 480 -mpeg2 -r 1500000 -ulaw -D
"ComedyP"

mythtv at mythtv:~$ openRTSP rtsp://192.168.0.2:8554/ > test.out
Opened URL "rtsp://192.168.0.2:8554/", returning a SDP description:
v=0
o=- 1201567609957990 1 IN IP4 192.168.0.2
s=ComedyP
i=LIVE555 Streaming Media v
t=0 0
a=tool:LIVE555 Streaming Media v2008.01.18
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:ComedyP
a=x-qt-text-inf:LIVE555 Streaming Media v
m=video 0 RTP/AVP 32
c=IN IP4 0.0.0.0
a=control:track1
m=audio 0 RTP/AVP 97
c=IN IP4 0.0.0.0
a=rtpmap:97 PCMU/48000/2
a=control:track2


mythtv at KUROHG:/myth/src/wis-streamer$ wis-streamer -i 2 -c
ntsc-cable:57 -t ntsc -p 8554 -w 640 -h 480 -mpeg2 -r 1500000 -pcm -D
"ComedyP"

mythtv at mythtv:~$ openRTSP rtsp://192.168.0.2:8554/ > test.out
Opened URL "rtsp://192.168.0.2:8554/", returning a SDP description:
v=0
o=- 1201567567961153 1 IN IP4 192.168.0.2
s=ComedyP
i=LIVE555 Streaming Media v
t=0 0
a=tool:LIVE555 Streaming Media v2008.01.18
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:ComedyP
a=x-qt-text-inf:LIVE555 Streaming Media v
m=video 0 RTP/AVP 32
c=IN IP4 0.0.0.0
a=control:track1
m=audio 0 RTP/AVP 97
c=IN IP4 0.0.0.0
a=rtpmap:97 L16/48000/2
a=control:track2


More information about the live-devel mailing list