Jump to content

Freebox Iptv RTSP port NAT and error


Kujuta

Recommended Posts

Hi,
 
I'm trying to set channel iptv via freebox rtsp channel.
It work on my computer via VLC with rtsp port use configured on specific and unique port and configure my NAT's firewal to route the same port.
 
But on emby server, there's a issue.
In fact, I've added my .m3u playlist channel and Emby server is viewing good all channel but when I try to launch in order to see a channel, there is failed and I think that's because no port is configured and so my firewall blocked it like I've seeing this post which is about it : https://emby.media/community/index.php?/topic/34296-m3u-streaming-not-working/?hl=%2Brtsp+%2Bconfig
 
I'd search options to configure rtsp parameters on Emby server like on VLC but nothing viewed.
There are perhaps a config file which I can configure it ?
 

This is the configure .m3u added on iptv : post-161801-0-83745900-1476781599_thumb.jpg

 

This is how kodi launch "Channel" whihch is failed : post-161801-0-34660400-1476781610_thumb.jpg

 

This is how kodi viewed list channel with channel tv (exprimental) : post-161801-0-71767300-1476781611_thumb.jpg post-161801-0-80616700-1476781613_thumb.jpg

 

This is how kodi try to launch channel selected : post-161801-0-75641300-1476781612_thumb.jpg

 

And this is the log when Kodi try to launch channel selected : 

2016-10-18 11:04:36.0904 Info HttpServer: HTTP GET http://192.168.1.155:18096/emby/Users/ebe9fb97d7e449a6bf9129edeb927177/Items/ee4177fdc8586c11546cba9ba3c848ad?format=json. UserAgent: python-requests/2.9.1
2016-10-18 11:04:36.1400 Info HttpServer: HTTP Response 200 to 192.168.1.100. Time: 50ms. http://192.168.1.155:18096/emby/Users/ebe9fb97d7e449a6bf9129edeb927177/Items/ee4177fdc8586c11546cba9ba3c848ad?format=json
2016-10-18 11:04:36.1741 Info HttpServer: HTTP HEAD http://192.168.1.155:18096/emby/Videos/ee4177fdc8586c11546cba9ba3c848ad/stream.ts?audioCodec=copy&videoCodec=copy. UserAgent: Kodi/16.1 (Windows NT 10.0; WOW64) App_Bitness/32 Version/16.1-Git:20160424-c327c53
2016-10-18 11:04:36.2266 Info HttpServer: HTTP Response 200 to 192.168.1.100. Time: 53ms. http://192.168.1.155:18096/emby/Videos/ee4177fdc8586c11546cba9ba3c848ad/stream.ts?audioCodec=copy&videoCodec=copy
2016-10-18 11:04:36.2408 Info HttpServer: HTTP HEAD http://192.168.1.155:18096/emby/Videos/ee4177fdc8586c11546cba9ba3c848ad/stream.ts?audioCodec=copy&videoCodec=copy. UserAgent: Kodi/16.1 (Windows NT 10.0; WOW64) App_Bitness/32 Version/16.1-Git:20160424-c327c53
2016-10-18 11:04:36.2602 Info HttpServer: HTTP GET http://192.168.1.155:18096/emby/Videos/ee4177fdc8586c11546cba9ba3c848ad/stream.ts?audioCodec=copy&videoCodec=copy. UserAgent: Kodi/16.1 (Windows NT 10.0; WOW64) App_Bitness/32 Version/16.1-Git:20160424-c327c53
2016-10-18 11:04:36.2692 Info HttpServer: HTTP Response 200 to 192.168.1.100. Time: 29ms. http://192.168.1.155:18096/emby/Videos/ee4177fdc8586c11546cba9ba3c848ad/stream.ts?audioCodec=copy&videoCodec=copy
2016-10-18 11:04:37.7882 Info App: /var/packages/EmbyServer/target/ffmpeg/bin/ffmpeg -fflags +genpts -i "rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=sd" -sn -codec:v:0 copy -map_metadata -1 -threads 0 -codec:a:0 copy -y "/var/packages/EmbyServer/target/var/transcoding-temp/3456e4a6e396cbd29c41442eb78dbc76.ts"
2016-10-18 11:04:48.0508 Info App: FFMpeg exited with code 1
2016-10-18 11:04:48.0732 Error ServiceStackHost: 192.168.1.155:18096 Request not found: /emby/Videos/ee4177fdc8586c11546cba9ba3c848ad/stream.ts?audioCodec=copy&videoCodec=copy
2016-10-18 11:04:48.0753 Info HttpServer: HTTP Response 404 to 192.168.1.100. Time: 11816ms (slow). http://192.168.1.155:18096/emby/Videos/ee4177fdc8586c11546cba9ba3c848ad/stream.ts?audioCodec=copy&videoCodec=copy
 
Thanks and regards
Kujuta
 
nb : there aresome screenshoot to view configuration and some failed.
Edited by Kujuta
Link to comment
Share on other sites

Hi,

 

Thanks for helping :)

This is the last ffmpeg transcode log corresponding to the try to view channel on playlist freebox tv .m3u.

 



cat ffmpeg-transcode-5e33ea07-66c1-408c-a796-344806da18b3.txt
http://192.168.1.155:18096/emby/videos/2a31ada4635e9ca062cd3867ef24a65a/live.m3u8?DeviceId=3a6dd0b2f87a56258a420ab14d9e6bfbd4b3040b&MediaSourceId=52097d1138ea4693b561487a997a83b8fb20f2f316403883923f68d744c507fe&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=-1&VideoBitrate=32698792&AudioBitrate=192000&MaxAudioChannels=6&Level=51&Profile=high&PlaySessionId=b6a65e3e87ce4308b09c2512daaad539&api_key=86d4ad6147c74373a97e3f7137640735&CopyTimestamps=false&TranscodingMaxAudioChannels=2&EnableSubtitlesInManifest=false&EnableSplittingOnNonKeyFrames=false


{"Protocol":"Rtsp","Id":"52097d1138ea4693b561487a997a83b8fb20f2f316403883923f68d744c507fe","Path":"rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=ld","Type":"Default","ReadAtNativeFramerate":false,"SupportsTranscoding":true,"SupportsDirectStream":false,"SupportsDirectPlay":true,"IsInfiniteStream":true,"RequiresOpening":false,"RequiresClosing":false,"BufferMs":1500,"MediaStreams":[{"IsInterlaced":true,"IsDefault":false,"IsForced":false,"Type":"Video","Index":-1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false},{"DisplayTitle":"","IsInterlaced":false,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":-1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false}],"PlayableStreamFileNames":[],"Formats":[],"RequiredHttpHeaders":{}}


/var/packages/EmbyServer/target/ffmpeg/bin/ffmpeg -fflags +genpts -i "rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=ld" -map_metadata -1 -threads 0 -sn -codec:v:0 libx264 -pix_fmt yuv420p -preset superfast -crf 23 -tune zerolatency -b:v 32698792 -maxrate 32698792 -bufsize 65397584 -vsync -1 -profile:v high -level 4.1 -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0" -flags -global_header -sc_threshold 0 -codec:a:0 aac -strict experimental -ac 2 -ab 192000 -af "adelay=1,aresample=async=1" -hls_time 3 -start_number 0 -hls_list_size 0 -hls_base_url "hls/115e17bb43e8d9cd3249b607bcc7dcbd/" -y "/var/packages/EmbyServer/target/var/transcoding-temp/115e17bb43e8d9cd3249b607bcc7dcbd.m3u8"




ffmpeg version 3.1.4-20161004T083307UTC Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --prefix=/var/packages/EmbyServer/target/ffmpeg --enable-cross-compile --cross-prefix=arm-linux-gnueabihf- --target-os=linux --disable-rpath --arch=arm --cpu=cortex-a9 --enable-thumb --enable-gpl --enable-shared --disable-static --disable-debug --disable-ffplay --disable-ffserver --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --enable-gnutls --enable-libass --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libfreetype --enable-fontconfig --enable-gray --enable-libfribidi --enable-libvidstab --enable-libzimg --disable-indev=sndio --disable-outdev=sndio --extra-version=20161004T083307UTC --extra-libs='-lm -ldl -lrt -lpthread -llzma -lz -lstdc++ '
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
[rtsp @ 0x650a0] UDP timeout, retrying with TCP
[rtsp @ 0x650a0] method PAUSE failed: 501 Not Implemented
rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=ld: could not find codec parameters


I'm seeing 



[rtsp @ 0x650a0] UDP timeout, retrying with TCP


this is why I think that's my nat firewall which is blocking traffic rtsp

 

Thanks :)

Kujuta

Edited by Kujuta
Link to comment
Share on other sites

Hi,

 

In order to try  understanding this problem, I watched the nat log firewall and analysed all emby server pacquet which included rtsp paquet in order to know the port or ports utilised.

 

Some example of log here :

20/10/2016 11:25,Warning,
192.168.1.1,ACCEPT
IN=br0 OUT=vlan1
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=36 TOS=0x00 PREC=0x00 TTL=63 ID=58020 DF 
PROTO=UDP 
SPT=7107 
DPT=32771 
LEN=16 

20/10/2016 11:25,Warning,
192.168.1.1,ACCEPT
IN=br0 OUT=vlan1
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=40 TOS=0x00 PREC=0x00 TTL=63 ID=58019 DF 
PROTO=UDP 
SPT=7106 
DPT=32770 
LEN=20 

20/10/2016 11:25,Warning,
192.168.1.1,ACCEPT
IN=br0 OUT=vlan1
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=27698 DF 
PROTO=TCP 
SPT=35247 
DPT=554 
SEQ=3000075551 ACK=0 WINDOW=14600 RES=0x00 SYN URGP=0 OPT (020405B40402080A0101E92D00000000010

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=36 TOS=0x00 PREC=0x00 TTL=63 ID=16834 DF 
PROTO=UDP 
SPT=11331 
DPT=32777 
LEN=16 

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=40 TOS=0x00 PREC=0x00 TTL=63 ID=16833 DF 
PROTO=UDP 
SPT=11330 
DPT=32776 
LEN=20 

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=8408 DF 
PROTO=TCP 
SPT=35435 
DPT=554 
SEQ=1353992499 ACK=0 WINDOW=14600 RES=0x00 SYN URGP=0 OPT (020405B40402080A010369EB000000000103

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=36 TOS=0x00 PREC=0x00 TTL=63 ID=13700 DF 
PROTO=UDP 
SPT=16417 
DPT=32775 
LEN=16 

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=40 TOS=0x00 PREC=0x00 TTL=63 ID=13699 DF 
PROTO=UDP 
SPT=16416 
DPT=32774 
LEN=20 

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=4419 DF 
PROTO=TCP 
SPT=35404 
DPT=554 
SEQ=2505719279 ACK=0 WINDOW=14600 RES=0x00 SYN URGP=0 OPT (020405B40402080A01032CAC000000000103

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=36 TOS=0x00 PREC=0x00 TTL=63 ID=7405 DF 
PROTO=UDP 
SPT=15745 
DPT=32773 
LEN=16 

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=40 TOS=0x00 PREC=0x00 TTL=63 ID=16833 DF 
PROTO=UDP 
SPT=11330 
DPT=32776 
LEN=20 

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=60 TOS=0x00 PREC=0x00 TTL=63 ID=8408 DF 
PROTO=TCP 
SPT=35435 
DPT=554 
SEQ=1353992499 ACK=0 WINDOW=14600 RES=0x00 SYN URGP=0 OPT (020405B40402080A010369EB000000000103

ACCEPT 
IN=br0 OUT=vlan1 
SRC=192.168.1.155(DS212) DST=212.27.38.253(freeplayer) 
LEN=36 TOS=0x00 PREC=0x00 TTL=63 ID=13700 DF 
PROTO=UDP 
SPT=16417 
DPT=32775 
LEN=16 
The port request is the signing by DPT value.
After analysed this report, we can see that the emby server has send a paquet to the ip Freeplayer via the UDP protocol with some port like 32776, 32775, 32774, 32773, 32771, or 32770 and has send another pacquet to the ip Freeplayer by TCP protocol with 554 port., but I don't know what this request is.
 
 
All differents UDP requests have tried a variable port which is between 32770 and 32777 from what I see but there are perhaps a lot of other ports ?

 

I'll trying with a NAT routing port range 32770 - 32779 in order to see what's happening after that UDP request when have responsive completed status.

 

I'll come back to share my tests and what I understand after that, but I'm no very skilled on network domain.

 

Thanks & regards

Kujuta

 

 

EDIT : apparently, this ip address 212.27.38.253(freeplayer) is a IP public but rest in the LAN Network and this is this IP which is calling the real IP of the FAI video flux (hidden IP for reason copyright) which return the video flux to the source requesting.
I'm seeing a other port used, so I'll continue to try with opening this port and see what's happening...
 
EDIT2 : Ok, so I've opening the port used of the sending request of freeplayer to the real IP of the FAI channel. This is normally accepted and then, a new request is send with a new other port. Ok I'm opening this port too and then, a new request is send, and bis repetita... 
I think that rtsp protocol is using a random port and this is why VLC couldn't play anything before a patch which permit configure port used with rtsp protocol.
So, VLC can now played the channel by this way.
 
So, can you (or can I make this maybe ?) implement this parameter in order to Embyserver can run channel played ? :)
Edited by Kujuta
Link to comment
Share on other sites

Hi,

 

I'm coming back about this problem.

After reading the ffmepg doc (https://www.ffmpeg.org/ffmpeg-protocols.html), I can see there are some parameters about rtsp ports used, especially from those arguments : (https://www.ffmpeg.org/ffmpeg-protocols.html#rtsp)

 



- min_port
Set minimum local UDP port. Default value is 5000.




- max_port
Set maximum local UDP port. Default value is 65000.


The documention precise that this options can be set on the ffmpeg command line.


Options can be set on the ffmpeg/ffplay command line, or set in code via AVOptions or in avformat_open_input

So I imagine if we add an option to configure this advanced parameters, we can set min and max on a single port or port range that will be known and therefore routable in the firewall NAT.

 

What do you think about this ?

Perhaps I haven't nothing understand & write false everything :D

 

Thanks

Kujuta

 

nb : Yet be sorry for my bad english, I don't know if I get to be understandable all the time but I try to do my best that I can :D

Edited by Kujuta
Link to comment
Share on other sites

  • 5 years later...
neves000

Hi @Luke,

Old topic but I have the same need today.

Is it possible now to specify min_port and max_port for a RTSP stream? For the moment I have forwarded UDP ports 5000 to 65000 to Emby in my firewall but that's really a very wide range, I prefer to be able to use only a few ports.

Thank you.

Link to comment
Share on other sites

17 hours ago, neves000 said:

Hi @Luke,

Old topic but I have the same need today.

Is it possible now to specify min_port and max_port for a RTSP stream? For the moment I have forwarded UDP ports 5000 to 65000 to Emby in my firewall but that's really a very wide range, I prefer to be able to use only a few ports.

Thank you.

Hi, there is currently no option for this but it looks like something we could add.

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...