Page 1 of 1

Livestream Network Traffic is excessive

PostPosted: Sat Mar 03, 2012 4:35 pm
by jhb50
This makes no sense to me but perhaps someone can explain.

When playing a live stream which ffmpeg shows is h264 which my Samsung can play natively, the input data rate for the stream to my PC is typically in the 300,000 bytes/sec range, but the outputstream to the TV is 3 to 4 times that in the 1,000,000 bytes/sec range.

I know that we are transcoding livestreams to mpeg-ts format but that should not also involve transcoding of the video stream to MPEG-2 which these output data rates would suggest.

This puts a severe load on the network, and would be better with 300K in and 300K out. Any explanation?

Re: Livestream Network Traffic is excessive

PostPosted: Mon Mar 05, 2012 10:44 pm
by jhb50
Maybe I should have used a different title but with all the posts about loading delays and network loads when streaming, surely someone has an opinion on why the output datarate has exploded.

Re: Livestream Network Traffic is excessive

PostPosted: Tue Mar 06, 2012 8:32 am
by will
Can you post ffmpeg -i for the file. Looking at the profile it has to be an mp4 or flv with h264, otherwise (rpt rtsp etc.. which I guess yours is) it is transcoded to mpeg2video which will explain the extra network traffic.

Whats your network setup? 1MB/s should really strain it unless its a week wireless-g signial.

Re: Livestream Network Traffic is excessive

PostPosted: Tue Mar 06, 2012 6:45 pm
by jhb50
Thanks for your reply. I checked and indeed these are h264.flv streams which my Samsung D can play natively, and on checking my profile I found that the instruction to transcode to mpeg-ts without transcoding to MPEG-2 had been removed in the 6.2 release by making it a comment.
Obviously it should read "Uncommented" rather than "Removed"
  Code:
- <!-- <Matches container="flv" vCodec="h264"/>  -->
- <!--  looks like some (D?) devices play FLV@H264 natively so this could be removed   -->


So that's the reason for my data rate explosion and by removing the comments it now streams at normal rates.

My profile now contains
  Code:
- <Matches container="flv" vCodec="h264"/>
- <!--  looks like some (D?) devices play FLV@H264 natively so this could be uncommented = Done for my Samsung D   -->

Re: Livestream Network Traffic is excessive

PostPosted: Tue Mar 06, 2012 9:48 pm
by prodan
Hello, I have the same problem but on a Samsung Tv Series C. I changed my profile like you just as well as replacing the letter of the code, C for D also, with various combinations. Nothing changed, buffer, and buffer and more buffer (loading delays). Maybe I'm doing something wrong. I would appreciate help. Thank you.

Re: Livestream Network Traffic is excessive

PostPosted: Tue Mar 06, 2012 9:49 pm
by zip
so you're saying that the native flv stream is using more bandwidth than the remuxed mpegts?

Re: Livestream Network Traffic is excessive

PostPosted: Wed Mar 07, 2012 12:20 am
by jhb50
No, I'm saying that the commenting out of the x264.flv transcode to mpeg-ts causes the video to also be transcoded by the following rule which transcodes flv to mpeg2-mpegts resulting in an MPEG2 stream to the TV rather than an x264 which the D can play natively.

Re: Livestream Network Traffic is excessive

PostPosted: Wed Mar 07, 2012 12:23 am
by jhb50
I have the same problem but on a Samsung Tv Series C


Its quite possible the C series cannot play h264(avc).flv files natively. Its not a documented capability for my D series but it works.

Re: Livestream Network Traffic is excessive

PostPosted: Wed Mar 07, 2012 4:24 am
by prodan
In the manual of TV appearances does not support this format, but transcoding (or not) from Serviio console, channels can be viewed the same, but with the same buffer, cuts, delay, etc, impossible to see anything fluid. This happens on HD channels (all). I think for now I will not find a solution.

Re: Livestream Network Traffic is excessive

PostPosted: Mon Mar 12, 2012 7:05 am
by sarsonuk
Can someone tell me where the profile is so I can edit please,
Thanks
sarsonuk

Re: Livestream Network Traffic is excessive

PostPosted: Mon Mar 12, 2012 2:44 pm
by jhb50

Re: Livestream Network Traffic is excessive

PostPosted: Mon Mar 12, 2012 6:32 pm
by sarsonuk
Hi jhb50,
I have looked in the directory structure on the mac for this but can only find log4j.xml in the config directory, is the mac os the same as for windows?
Thanks

Re: Livestream Network Traffic is excessive

PostPosted: Mon Mar 12, 2012 9:02 pm
by jhb50
I would assume so. Serviio will not run without a valid profile.xml file.

Re: Livestream Network Traffic is excessive

PostPosted: Tue Mar 13, 2012 4:39 pm
by sarsonuk
Hi jhb50,

I have found the file but I am a little confused, it seems to me that the code isnt commented out for the mac version, see below, is this correct?
<Matches container="mp4" aCodec="lpcm" />
<Matches container="flv" vCodec="h264" /> <!-- looks like some (D?) devices play FLV@H264 natively so this could be removed -->
<Matches container="matroska" vCodec="h264" aCodec="flac" />
<Matches container="matroska" vCodec="h264" aCodec="vorbis" />
Thanks

Re: Livestream Network Traffic is excessive

PostPosted: Tue Mar 13, 2012 5:26 pm
by jhb50
I went back and rechecked the Windows release, and it was not commented out there either. I don't know how it got commented out on mine, but suffice to say with a D model you do not want it commented out.

Re: Livestream Network Traffic is excessive

PostPosted: Mon Mar 19, 2012 3:38 pm
by Scoty
I have a D Serie anf have changed to <Matches container="flv" vCodec="h264"/> <!-- looks like some (D?) devices play FLV@H264 natively so this could be uncommented = Done for my Samsung D --> . Is this ok?

Re: Livestream Network Traffic is excessive

PostPosted: Mon Mar 19, 2012 3:51 pm
by jhb50
Should be.

Re: Livestream Network Traffic is excessive

PostPosted: Thu Apr 05, 2012 12:02 pm
by vtec123
Scoty wrote:I have a D Serie anf have changed to <Matches container="flv" vCodec="h264"/> <!-- looks like some (D?) devices play FLV@H264 natively so this could be uncommented = Done for my Samsung D --> . Is this ok?




I have done the following Above and still the HD channel stop and start and choppy ...


What else can I do ?

thx

Re: Livestream Network Traffic is excessive

PostPosted: Mon Apr 09, 2012 10:54 pm
by alfista
I'm having a bit of a problem with this. For local material the Samsung C/D-profile works fine with my BD-D6500 bluray player, but for online material it's not been all plain sailing. It seems it can play some flv/h264 streams natively but not all.

I installed the LiveFeeds plugin and configured a bunch of the Livestream folders. Sadly most of the channels didn't work, the only HD-channel I got somewhat working was RCI TV for some reason, all other HD channels failed in a variety of ways (unsupported file format, unsupported video codec, black screen but the time count on the display incrementing at seemingly random intervals).
When I found this thread I had a look at profiles.xml and found that this line was not commented out, I changed this and suddenly a lot of the channels started working. I haven't really grasped all of how the profiles work, but my understanding is that if I comment out the flv@h264 line as in the code below, then the flv "catch all" in the next section will cause the file to be transcoded to mpeg2video?
  Code:
         <Video targetContainer="mpegts" targetACodec="ac3">
            <Matches container="mpegts" aCodec="mp2" />
            <Matches container="mp4" aCodec="lpcm" />
            <!-- <Matches container="flv" vCodec="h264" /> looks like some (D?) devices play FLV@H264 natively so this could be removed -->
            <Matches container="matroska" vCodec="h264" aCodec="flac" />
            <Matches container="matroska" vCodec="h264" aCodec="vorbis" />
            <Matches container="matroska" vCodec="h264" aCodec="truehd" />
            <Matches container="matroska" vCodec="vc1" />
            <Matches container="ogg" vCodec="mpeg4" />
            <Matches container="3gp" aCodec="amrnb" /> 
         </Video>   
         <!-- transcode MKV with MPEG2 video, remux into mpeg2ts -->
         <!-- transcode AVI with AVC video -->
         <Video targetContainer="mpegts" targetACodec="ac3" targetVCodec="mpeg2video" maxVBitrate="20000">
            <Matches container="matroska" vCodec="mpeg2video" />
            <Matches container="matroska" vCodec="vp8" />
            <Matches container="avi" vCodec="h264" />
            <Matches container="avi" vCodec="mjpeg" />
            <Matches container="avi" vCodec="dvvideo" />
            <Matches container="flv" />
            <Matches container="ogg" />
         </Video>


Since I'm still having the occasional problem, and was hoping to avoid unnecessary network load and cpu cycles caused by transcoding I'd like to understand why some streams work without transcoding and some not. I enabled debugging with transcoding enabled and checked how ffmpeg was invoked, but that didn't give any clues, or maybe I'm not looking at the right place.

In this case with transcoding both streams worked:
  Code:
2012-04-09 10:32:02,124 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: rtmp://93.114.44.21:1936/live/ swfUrl=http://veohcast.tv/veohcast.tv.swf pageurl=http://www.veohcast.tv playpath=eventtv swfVfy=0 live=1
2012-04-09 10:32:02,124 DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\bin\\..\lib/ffmpeg.exe -i rtmp://93.114.44.21:1936/live/ swfUrl=http://veohcast.tv/veohcast.tv.swf pageurl=http://www.veohcast.tv playpath=eventtv swfVfy=0 live=1 -y -threads 1 -async 1 -vcodec mpeg2video -b 20000k -maxrate 20000k -bufsize 20000k -r 24000/1001 -g 15 -copyts -acodec ac3 -ab 192k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts pipe:

2012-04-09 10:33:40,077 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: rtmp://s7.webport.tv/live/z050226.stream pageUrl=http://www.tvsector.com/ swfVfy=0 live=1
2012-04-09 10:33:40,078 DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\bin\\..\lib/ffmpeg.exe -i rtmp://s7.webport.tv/live/z050226.stream pageUrl=http://www.tvsector.com/ swfVfy=0 live=1 -y -threads 1 -async 1 -vcodec mpeg2video -b 20000k -maxrate 20000k -bufsize 20000k -r 25 -g 15 -copyts -acodec ac3 -ab 192k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts pipe:


In this case without transcoding, only the first stream worked:
  Code:
2012-04-09 11:24:40,200 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: rtmp://93.114.44.21:1936/live/ swfUrl=http://veohcast.tv/veohcast.tv.swf pageurl=http://www.veohcast.tv playpath=eventtv swfVfy=0 live=1
2012-04-09 11:24:40,200 DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\bin\\..\lib/ffmpeg.exe -i rtmp://93.114.44.21:1936/live/ swfUrl=http://veohcast.tv/veohcast.tv.swf pageurl=http://www.veohcast.tv playpath=eventtv swfVfy=0 live=1 -y -async 1 -vcodec copy -vbsf h264_mp4toannexb -copyts -acodec ac3 -ab 192k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts pipe:

2012-04-09 11:26:09,218 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: rtmp://s7.webport.tv/live/z050226.stream pageUrl=http://www.tvsector.com/ swfVfy=0 live=1
2012-04-09 11:26:09,220 DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\bin\\..\lib/ffmpeg.exe -i rtmp://s7.webport.tv/live/z050226.stream pageUrl=http://www.tvsector.com/ swfVfy=0 live=1 -y -async 1 -vcodec copy -vbsf h264_mp4toannexb -copyts -acodec ac3 -ab 192k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts pipe:


FFMPEG has the following to say about the two streams:
  Code:
Input #0, flv, from 'rtmp://93.114.44.21:1936/live/ swfUrl=http://veohcast.tv/veohcast.tv.swf pageurl=http://www.veohcast.tv playpath=eventtv swfVfy=0 live=1':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 1k tbn, 50 tbc
    Stream #0:1: Audio: aac, 44100 Hz, stereo, s16

Input #0, flv, from 'rtmp://s7.webport.tv/live/z050226.stream pageUrl=http://www.tvsector.com/ swfVfy=0 live=1':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 1k tbn, 50 tbc
    Stream #0:1: Audio: aac, 44100 Hz, stereo, s16

(The latter stream produced quite a lot of printout from ffmpeg that I omitted) Could it be something with the "constrained baseline" that's causing the problems? Is there any way I could find out more about the streams.
In the end, I might have to conclude that my player isn't really up to scratch, but first I'd like to see if it's possible to isolate the issue and if possible find a different workaround.