[MPlayer-dev-eng] [PATCH] fix rtsp_port for multiple streams

Tamas Vincze tom at vincze.org
Thu Sep 20 20:35:25 CEST 2012


Tried it and works correctly, the port doesn't increment for the next 
URL. Not sure why though...
See these lines below for both URLs:
Initiated "video/MP4V-ES" RTP subsession on port 6972
Initiated "audio/MPA" RTP subsession on port 6974

$ ./mplayer -ao null -vo x11 -rtsp-port 6972 rtsp://raspi/ 
rtsp://10.10.4.10/
MPlayer 1.1-4.7.0 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote 
control.

Playing rtsp://raspi/.
Resolving raspi for AF_INET6...

Couldn't resolve name for AF_INET6: raspi
Resolving raspi for AF_INET...
Connecting to server raspi[10.10.4.10]: 554...

A single media stream only is supported atm.
rtsp_session: unsupported RTSP server. Server type is 'unknown'.
STREAM_LIVE555, URL: rtsp://raspi/
Stream not seekable!
  file format detected.
Initiated "video/MP4V-ES" RTP subsession on port 6972
Initiated "audio/MPA" RTP subsession on port 6974
demux_rtp: Guessed the video frame rate as 30 frames-per-second.
         (If this is wrong, use the "-fps <frame-rate>" option instead.)
VIDEO:  [mp4v]  0x0  0bpp  11363.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 54.23.100 (internal)
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 81
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, 
II, III)
==========================================================================
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [x11] 320x240 => 320x240 Planar YV12
Shared memory not supported
Reverting to normal Xlib
[swscaler @ 0x1010080]using unscaled yuv420p -> bgra special converter
[mpeg4 @ 0xf46720]warning: first frame is no keyframe
A:   1.4 V:   2.7 A-V: -1.367 ct: -0.001 164/164 ??% ??% ??,?% 163 0


Playing rtsp://10.10.4.10/.
Resolving 10.10.4.10 for AF_INET6...

Couldn't resolve name for AF_INET6: 10.10.4.10
Connecting to server 10.10.4.10[10.10.4.10]: 554...

A single media stream only is supported atm.
rtsp_session: unsupported RTSP server. Server type is 'unknown'.
STREAM_LIVE555, URL: rtsp://10.10.4.10/
Stream not seekable!
  file format detected.
Initiated "video/MP4V-ES" RTP subsession on port 6972
Initiated "audio/MPA" RTP subsession on port 6974
demux_rtp: Guessed the video frame rate as 30 frames-per-second.
         (If this is wrong, use the "-fps <frame-rate>" option instead.)
VIDEO:  [mp4v]  0x0  0bpp  30.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Unsupported PixelFormat 61
Unsupported PixelFormat 53
Unsupported PixelFormat 81
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, 
II, III)
==========================================================================
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [x11] 320x240 => 320x240 Planar YV12
Shared memory not supported
Reverting to normal Xlib
[mpeg4 @ 0xf46720]warning: first frame is no keyframe
A:   1.6 V:   1.3 A-V:  0.265 ct:  0.107  76/ 76  5% 30%  0.3% 4 0

Exiting... (Quit)




> On Thu, Sep 20, 2012 at 01:44:50PM -0400, Tamas Vincze wrote:
>> Hi:
>>
>> The attached patch fixes a problem when playing multiple streams
>> (separate audio and video) over RTSP with user-specified -rtsp_port
>> <num>. Previously the same port was assigned to both streams that
>> resulted in a conflict.
>>
>> Tamas
>>
>>
>> --- demux_rtp.cpp.orig	2012-03-05 13:14:38.000000000 -0500
>> +++ demux_rtp.cpp	2012-09-20 13:34:05.886112488 -0400
>> @@ -222,7 +222,10 @@
>>         }
>>
>>         if (rtsp_port)
>> +      {
>>             subsession->setClientPortNum (rtsp_port);
>> +          rtsp_port += 2;	// RTP+RTCP uses two ports; give next stream the next two ports
>> +      }
> I am not completely sure and haven't tested, but:
> I think that will cause strange behaviour when doing
> -rtsp_port<something>  url1 url2
> in that url2 will not use<something>  but instead<something+4>  or so.
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng



More information about the MPlayer-dev-eng mailing list