Jump to content

Live TV - M3u Tuner


makarai

Recommended Posts

makarai

Hello Gents,

 

I am trying to get liveTV running using the m3u tuner, i created a m3u file that works flawlessly on a windows machine with VLC. I had to setup IGPM proxy and Multicast to get it working but now i can browse through 200 channels that my ISP provides, using VLC.

 

However, when I run the same file on my emby setup (freenas/ freebsd 11.1 ,  emby@3.4.5.1) its stuck in a loop, i am not sure why this is.

 

Here is the relevant part of log, i think. This may be very well a mono problem on freebsd, and if so i just like to know :D

 

cheers

2018-05-25 16:01:37.813 Info App: Opening SharedHttpStream Live stream from udp://@239.77.3.28:5000
2018-05-25 16:01:37.813 Info HttpClient: HttpClientManager GET: udp://@239.77.3.28:5000
2018-05-25 16:01:37.814 Error HttpClient: Error ConnectFailure getting response from udp://@239.77.3.28:5000
	*** Error Report ***
	Version: 3.4.1.5
	Command line: /usr/local/lib/emby-server/MediaBrowser.Server.Mono.exe -os freebsd -ffmpeg /usr/local/bin/ffmpeg -ffprobe /usr/local/bin/ffprobe -programdata /var/db/emby-server
	Operating system: Unix 11.1.0.0
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: False
	Mono: 5.2.0 (5.2.0.215 Thu May 10 05:20:07 UTC 2018)
	Processor count: 8
	Program data path: /var/db/emby-server
	Application directory: /usr/local/lib/emby-server
	System.Net.WebException: Error: ConnectFailure (An address incompatible with the requested protocol was used) ---> System.Net.Sockets.SocketException: An address incompatible with the requested protocol was used
	  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000b6] in <cc62094645e2448f88c8135e6f498de3>:0 
	  at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x0016d] in <cc62094645e2448f88c8135e6f498de3>:0 
	   --- End of inner exception stack trace ---
	  at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00058] in <cc62094645e2448f88c8135e6f498de3>:0 
	  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x0000f] in <c5bcd0ec45b240acb20cfcfa5eee2246>:0 
	System.Net.WebException
	  at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00058] in <cc62094645e2448f88c8135e6f498de3>:0 
	  at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x0000f] in <c5bcd0ec45b240acb20cfcfa5eee2246>:0 
	InnerException: System.Net.Sockets.SocketException
	System.Net.Sockets.SocketException (0x80004005): An address incompatible with the requested protocol was used
	  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000b6] in <cc62094645e2448f88c8135e6f498de3>:0 
	  at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x0016d] in <cc62094645e2448f88c8135e6f498de3>:0 
	  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000b6] in <cc62094645e2448f88c8135e6f498de3>:0 
	  at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) [0x0016d] in <cc62094645e2448f88c8135e6f498de3>:0 
Link to comment
Share on other sites

Please try the latest beta, then attach the complete emby server log if there is still an issue. Thanks.

Link to comment
Share on other sites

makarai

In the mean time i also update the jail ffmpeg to 4.0... and mono to the latest that is available, which is still 5.2.0.215_1

 

Thanks mate!

 

-mak

 

 

Log (2).txt

Link to comment
Share on other sites

In the mean time i also update the jail ffmpeg to 4.0... and mono to the latest that is available, which is still 5.2.0.215_1

 

Thanks mate!

 

-mak

 

 

Ok, I see what's happening here. Putting udp addresses inside an m3u is something that hasn't been tested before. We can look into this but for best results you may want to consider using http urls.

Link to comment
Share on other sites

And taking a look I think it's actually a quick fix, but please be advised that going forward the betas will now require mono 5.4+.

Link to comment
Share on other sites

makarai

And taking a look I think it's actually a quick fix, but please be advised that going forward the betas will now require mono 5.4+.

 

I get these udp links from my ISP i doubt i can use HTTP :(

 

Lets Hope someone ports the new mono versions for freebsd, seeing how fast the ports are being updated i doubt it will happen this year...

https://www.freshports.org/lang/mono

 

thanks for looking into it, much appreciated !

Edited by makarai
Link to comment
Share on other sites

makarai

@@Luke , i have an instance running with the beta versions of emby running so i'll periodically check if it will work, however i am wondering if it is planned to allow udp links in the m3u playlist. For me it would be excellent as i will receive all my standard broadcasting this way. 

 

i tried XXXX_10_beta

and i think the error changed 

emby_Log.txt

Edited by makarai
Link to comment
Share on other sites

It's been added in the latest beta. But as I mentioned earlier, the latest beta now requires mono 5.4 and you only have 5.2, so I really can't predict what's going to happen. You can see my comments on the matter here:

 

https://emby.media/community/index.php?/topic/56481-securechannelfailure-on-freenas/page-3&do=findComment&comment=582901

 

Thanks.

Link to comment
Share on other sites

Strangely though the server actually appears to be running ok, although there will be problems at some point.

 

However the error about ffmpeg with udp i cannot test so I'll need your help. This launch of ffmpeg is failing:

/usr/local/bin/ffmpeg -analyzeduration 3000000 -fflags +igndts -i "udp://@239.77.3.28:5000" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 23 -maxrate 20000000 -bufsize 40000000 -profile:v high -level 4.1 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync -1 -codec:a:0 aac -strict experimental -ac 2 -ab 192000  -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/93403027f3843fecffe6f3107fa22acc/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/db/emby-server/transcoding-temp/93403027f3843fecffe6f3107fa22acc.m3u8" -y "/var/db/emby-server/transcoding-temp/93403027f3843fecffe6f3107fa22acc%d.ts"

Maybe you can try this manually in a terminal and find out what the problem is. If the server generated an ffmpeg log, that might have some clues.

Link to comment
Share on other sites

makarai

Strangely though the server actually appears to be running ok, although there will be problems at some point.

 

However the error about ffmpeg with udp i cannot test so I'll need your help. This launch of ffmpeg is failing:

/usr/local/bin/ffmpeg -analyzeduration 3000000 -fflags +igndts -i "udp://@239.77.3.28:5000" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 23 -maxrate 20000000 -bufsize 40000000 -profile:v high -level 4.1 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync -1 -codec:a:0 aac -strict experimental -ac 2 -ab 192000  -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/93403027f3843fecffe6f3107fa22acc/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/db/emby-server/transcoding-temp/93403027f3843fecffe6f3107fa22acc.m3u8" -y "/var/db/emby-server/transcoding-temp/93403027f3843fecffe6f3107fa22acc%d.ts"

Maybe you can try this manually in a terminal and find out what the problem is. If the server generated an ffmpeg log, that might have some clues.

 

 

I am aware of the mono issues but as a helpless user there is nothing i can do besides waiting. Here is the ffmpeg log upon starting:

2018-05-31 19:15:08.998
Application version: 3.4.1.10

http://192.168.0.108:8096/emby/videos/c8313d07c4913c6b2b414b45d5d67212/live.m3u8?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzY2LjAuMzM1OS4xODEgU2FmYXJpLzUzNy4zNnwxNTI3NzY3NzI2OTg2&MediaSourceId=a35349df79e0941b39760fdd662c0cd8&VideoCodec=h264&AudioCodec=mp3,aac&AudioStreamIndex=-1&VideoBitrate=139808000&AudioBitrate=192000&PlaySessionId=0ae3ee1129cc454585933d3db6e0945b&api_key=0c036dfd49804ed9a99da69184a4b7d4&LiveStreamId=a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_a35349df79e0941b39760fdd662c0cd8&TranscodingMaxAudioChannels=2&RequireAvc=true&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=51&h264-deinterlace=true&TranscodeReasons=ContainerNotSupported,VideoCodecNotSupported,AudioCodecNotSupported

{"Protocol":"Udp","Id":"a35349df79e0941b39760fdd662c0cd8","Path":"udp://@239.77.3.28:5000","Type":"Default","IsRemote":true,"ReadAtNativeFramerate":false,"IgnoreDts":true,"IgnoreIndex":false,"GenPtsInput":false,"SupportsTranscoding":true,"SupportsDirectStream":false,"SupportsDirectPlay":true,"IsInfiniteStream":true,"RequiresOpening":true,"RequiresClosing":true,"LiveStreamId":"a17c75760a04e99b68cf766e11316e1c_09efa0d56b934a82adec00a87b837fb0_a35349df79e0941b39760fdd662c0cd8","RequiresLooping":false,"SupportsProbing":true,"MediaStreams":[{"VideoRange":"SDR","DisplayTitle":"","IsInterlaced":true,"BitRate":20000000,"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}],"Formats":[],"Bitrate":20000000,"RequiredHttpHeaders":{},"AnalyzeDurationMs":3000}

User policy for zwck: EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True

/usr/local/bin/ffmpeg -analyzeduration 3000000 -fflags +igndts -i "udp://@239.77.3.28:5000" -map_metadata -1 -map_chapters -1 -threads 0 -sn -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 23 -maxrate 20000000 -bufsize 40000000 -profile:v high -level 4.1 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames "expr:gte(t,n_forced*3)" -vf "yadif=0:-1:0,scale=trunc(min(max(iw\,ih*dar)\,1920)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync -1 -codec:a:0 aac -strict experimental -ac 2 -ab 192000  -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3  -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/6accfa13eca2dd8fa5a58822067f8088/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/var/db/emby-server/transcoding-temp/6accfa13eca2dd8fa5a58822067f8088.m3u8" -y "/var/db/emby-server/transcoding-temp/6accfa13eca2dd8fa5a58822067f8088%d.ts"

ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
  configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --enable-shared --enable-pic --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --cc=cc --disable-alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libass --disable-libbs2b --disable-libcaca --disable-libcdio --disable-libcelt --disable-chromaprint --disable-libcodec2 --disable-libdc1394 --disable-debug --enable-htmlpages --disable-libdrm --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --disable-libfribidi --disable-libgme --disable-libgsm --enable-iconv --disable-libilbc --disable-libjack --disable-libkvazaar --disable-ladspa --disable-libmp3lame --disable-libbluray --disable-librsvg --disable-libxml2 --disable-lv2 --enable-mmx --disable-libmodplug --disable-libmysofa --disable-openal --disable-opencl --enable-libopencv --disable-opengl --disable-libopenh264 --disable-libopenjpeg --enable-optimizations --enable-libopus --disable-libpulse --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --disable-libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-libspeex --enable-sse --disable-libssh --disable-libtesseract --enable-libtheora --disable-libtwolame --enable-libv4l2 --enable-vaapi --enable-vdpau --disable-libvidstab --enable-libvorbis --disable-libvo-amrwbenc --enable-libvpx --disable-libwavpack --disable-libwebp --enable-libx264 --enable-libx265 --disable-libxcb --enable-libxvid --disable-outdev=xv --disable-libzimg --disable-libzmq --disable-libzvbi --disable-gcrypt --enable-gmp --disable-librtmp --enable-gnutls --disable-openssl --enable-version3 --disable-nonfree --disable-libaom --disable-libsrt
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
[udp @ 0x80c045400] bind failed: Address already in use
udp://@239.77.3.28:5000: Input/output error
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
  configuration: --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --pkgconfigdir=/usr/local/libdata/pkgconfig --enable-shared --enable-pic --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --cc=cc --disable-alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libass --disable-libbs2b --disable-libcaca --disable-libcdio --disable-libcelt --disable-chromaprint --disable-libcodec2 --disable-libdc1394 --disable-debug --enable-htmlpages --disable-libdrm --disable-libfdk-aac --disable-libflite --enable-fontconfig --enable-libfreetype --enable-frei0r --disable-libfribidi --disable-libgme --disable-libgsm --enable-iconv --disable-libilbc --disable-libjack --disable-libkvazaar --disable-ladspa --disable-libmp3lame --disable-libbluray --disable-librsvg --disable-libxml2 --disable-lv2 --enable-mmx --disable-libmodplug --disable-libmysofa --disable-openal --disable-opencl --enable-libopencv --disable-opengl --disable-libopenh264 --disable-libopenjpeg --enable-optimizations --enable-libopus --disable-libpulse --enable-runtime-cpudetect --disable-librubberband --disable-sdl2 --disable-libsmbclient --disable-libsnappy --disable-sndio --disable-libsoxr --disable-libspeex --enable-sse --disable-libssh --disable-libtesseract --enable-libtheora --disable-libtwolame --enable-libv4l2 --enable-vaapi --enable-vdpau --disable-libvidstab --enable-libvorbis --disable-libvo-amrwbenc --enable-libvpx --disable-libwavpack --disable-libwebp --enable-libx264 --enable-libx265 --disable-libxcb --enable-libxvid --disable-outdev=xv --disable-libzimg --disable-libzmq --disable-libzvbi --disable-gcrypt --enable-gmp --disable-librtmp --enable-gnutls --disable-openssl --enable-version3 --disable-nonfree --disable-libaom --disable-libsrt
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
[udp @ 0x80c045400] bind failed: Address already in use
udp://@239.77.3.28:5000: Input/output error
Edited by makarai
Link to comment
Share on other sites

That error suggests that the udp url only supports a single application connected to it at a time and that it's already in use.

 

I have no ability to test this so that's as much as I can tell you right now.

Link to comment
Share on other sites

makarai

That error suggests that the udp url only supports a single application connected to it at a time and that it's already in use.

 

I have no ability to test this so that's as much as I can tell you right now.

 

 

That is weird, i tried the following, i disconnected every single computer on my network and played a channel, and i get this error. Then i turned on every single computer on my network and started the same channel using vlc and it works simultaneously on 2 pc 3 laptops and 2 tablets and a mobile phone :( Not sure why this error pops up

Link to comment
Share on other sites

This is just a guess but the problem could be in ffmpeg. it could be sending multiple connection attempts to the same udp address, even though it can't handle it.

 

I'm sure you can easily create the problem outside of Emby by running the ffmpeg command from a terminal. Based on that, if you were able to find some adjustments that could be made to accommodate the needs of your udp server, then we could incorporate them into the command line.

Link to comment
Share on other sites

makarai

As it is tradition i doubt the error is in ffmpeg, i quickly installed ubuntu+emby+etc pp and the stream capturing via the console worked directly. (i didn't test the livetv option).

 

It seems to me, with my limited understanding, that when installing emby in an iocage on freebsd11.1 the multicast option is not available which then crashes the ffprobe part of ffmpeg. Of course with my limited knowledge of freebsd, jails and kernels, i doubt i can fix this. Thanks Luke for the pointers.

Link to comment
Share on other sites

makarai

Just as it is even more tradition i got it to work. When creating a jail you have to use the cli and create it with 

iocage create -n "emby_foo" -r 11.1-RELEASE ip4_addr="vnet0|192.168.0.107/24" defaultrouter="192.168.0.1" vnet="on" allow_raw_sockets="1" boot="on"

Then ffmpeg can fetch the stream ! thx for the help

Edited by makarai
  • Like 1
Link to comment
Share on other sites

  • 1 month later...
makarai

Hi, i am really happy that the iptv that my ISP provides now runs on emby natively with the m3u8 tuner. When i check the stat for nerds tab however it reports video,audio, container not supported. i attached the transcoding logfile and the server logfile, maybe this is just the usual.

 

 

 

Logserver.txt

transcoderlog.txt

Link to comment
Share on other sites

It's transcoding due to interlaced video although with the next release we'll just let it play in the browser, and see how the browser handles it. Thanks.

Link to comment
Share on other sites

makarai

It's transcoding due to interlaced video although with the next release we'll just let it play in the browser, and see how the browser handles it. Thanks.

 

Thank you for the update. 

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...