NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 3 4 5 6 7 … 93 Next »
Media Browser Integration

 
  • 0 Vote(s) - 0 Average
Media Browser Integration
lukemb3
Offline

Member

Posts: 109
Threads: 1
Joined: Jul 2013
#371
2014-03-09, 02:17 PM
Are you making sure to put the url into the Url property and not Path?

The reason for the duplicate calls is most likely due to the failures. In the html5 video element we list out several formats. Browser tries the first one, it fails, then tries the second, etc. So we can probably fix the duplicate call just by getting to succeed the first time.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,133
Threads: 957
Joined: May 2006
#372
2014-03-09, 03:09 PM
lukemb3 Wrote:Are you making sure to put the url into the Url property and not Path?.

Yes I log it and it plays as a url

Code:
public async Task<LiveStreamInfo> GetChannelStream(string channelOid, CancellationToken cancellationToken)
        {
            heartBeats++;
            var baseUrl = Plugin.Instance.Configuration.WebServiceUrl;
            string streamUrl = string.Format("{0}/live?channeloid={1}&clientid=MB3", baseUrl, channelOid);
            _logger.Debug("Streaming " + streamUrl);
            return new LiveStreamInfo
            {
                Id = heartBeats.ToString(),
                Url = streamUrl
            };            
            throw new ResourceNotFoundException(string.Format("Could not stream channel {0}", channelOid));
      }

What happens is my server logs end up like this

Code:
2014-03-09 10:56:43.2901 Info - App: Opening channel stream from Next Pvr, external channel Id: 6865
2014-03-09 10:56:43.2901 Debug - App: Streaming http://172.16.3.2:8866/live?channeloid=6865&clientid=MB3
2014-03-09 10:56:43.3141 Info - App: C:\Users\Martin\AppData\Roaming\MediaBrowser-Server\ffmpeg\20140304\ffmpeg.exe -fflags genpts -re -i -  -vcodec libx264 -force_key_frames expr:if(isnan(prev_forced_t),gte(t,.1),gte(t,prev_forced_t+5)) -vf "yadif=0:-1:0,scale=min(iw\,1280):trunc(ow/a/2)*2" -preset ultrafast -crf 23 -maxrate 1372000 -bufsize 2744000 -vsync vfr -profile:v baseline -level 3 -map_metadata -1 -threads 2  -f mp4 -movflags frag_keyframe+empty_moov "C:\Users\Martin\AppData\Roaming\MediaBrowser-Server\transcoding-temp\84e9b8bb-6e05-ee89-2607-da042cc097cc.mp4"
2014-03-09 10:56:43.3491 Error - App: Error writing to standard input
    URI formats are not supported.
    System.ArgumentException
       at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
       at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
       at MediaBrowser.Common.Implementations.IO.CommonFileSystem.GetFileStream(String path, FileMode mode, FileAccess access, FileShare share, Boolean isAsync)
       at MediaBrowser.Api.Playback.BaseStreamingService.<StreamToStandardInputInternal>d__17.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at MediaBrowser.Api.Playback.BaseStreamingService.<StreamToStandardInput>d__14.MoveNext()

and the browser goes to waiting for local host.

The ffmpeg txt file is 0 bytes.

Martin
lukemb3
Offline

Member

Posts: 109
Threads: 1
Joined: Jul 2013
#373
2014-03-09, 03:15 PM
Ah ok, that's my fault. Since swmc is not using Url I hadn't completed implementing it yet. I'll take care of it today. Thanks.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,133
Threads: 957
Joined: May 2006
#374
2014-03-09, 03:30 PM
Ok good. I wouldn't mind getting the file-based method working optionally since it would be seekable. I'm not sure what I have to do to make it a valid call first tiime. The error is always the pipe has been ended.

Before returning I make sure the file exists but it wasn't until I added the second wait and bumped it to 20 seconds did it work.

Code:
while (!File.Exists(VLCObj.StreamLocation))
                {
                    await Task.Delay(200).ConfigureAwait(false);
                }
                await Task.Delay(20000).ConfigureAwait(false);

Martin
lukemb3
Offline

Member

Posts: 109
Threads: 1
Joined: Jul 2013
#375
2014-03-09, 03:43 PM
I'd probably need to see the mbs server log, and also the full code of the GetChannelStream method.
lukemb3
Offline

Member

Posts: 109
Threads: 1
Joined: Jul 2013
#376
2014-03-09, 03:50 PM
Also would it be possible to stop and resync? I'd like to merge in your current changes. That will allow us to test some of these things ourselves so that you're not consuming your own time if the issue is on our side.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,133
Threads: 957
Joined: May 2006
#377
2014-03-09, 04:12 PM
lukemb3 Wrote:I'd probably need to see the mbs server log, and also the full code of the GetChannelStream method.

Code is hacked to work on my backend, mb3 and dev nextpvr on my localhost

Code:
public async Task<LiveStreamInfo> GetChannelStream(string channelOid, CancellationToken cancellationToken)
        {
            var baseUrl = Plugin.Instance.Configuration.WebServiceUrl;

            var options = new HttpRequestOptions()
            {
                CancellationToken = cancellationToken,
                Url = string.Format("{0}/public/VLCService?Channel={1}", baseUrl.Replace("127.0.0.1","172.16.3.2"),"998")
            };

            using (var stream = await _httpClient.Get(options).ConfigureAwait(false))
            {
                var VLCObj = new VLCResponse().GetVLCResponse(stream, _jsonSerializer);
                _logger.Debug(VLCObj.StreamLocation);

                while (!File.Exists(VLCObj.StreamLocation))
                {
                    await Task.Delay(200).ConfigureAwait(false);
                }
                await Task.Delay(20000).ConfigureAwait(false);
                _logger.Debug("Finishing");
                heartBeats++;
                heartBeat.Add(heartBeats, VLCObj.ProcessId);
                return new LiveStreamInfo
                {
                    Id = heartBeats.ToString(),
                    Path = VLCObj.StreamLocation
                };            
            }
      }

Log attached

Martin
lukemb3
Offline

Member

Posts: 109
Threads: 1
Joined: Jul 2013
#378
2014-03-09, 04:31 PM
For one thing, in HttpRequestOptions, set BufferContent to false.

Second - you might not want to use a using statement here. it means the stream will get disposed immediately when you return the LiveStreamInfo object. If you're going to try and do this, I think you'll have to keep the stream in memory and dispose it later when CloseLiveStream is called.

Whether that will remove the need to have the 20 second delay, I'm not sure, but I would start by making those changes.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,133
Threads: 957
Joined: May 2006
#379
2014-03-09, 04:54 PM
lukemb3 Wrote:Second - you might not want to use a using statement here. it means the stream will get disposed immediately when you return the LiveStreamInfo object. If you're going to try and do this, I think you'll have to keep the stream in memory and dispose it later when CloseLiveStream is called.

The object being disposed is only the NEWA JSON response stream that is returned after NEWA starts the capture and returns the filename.

Martin
lukemb3
Offline

Member

Posts: 109
Threads: 1
Joined: Jul 2013
#380
2014-03-09, 05:20 PM
is 20 the lowest delay you've been able to reach? even with 20, does the channel play for a long period of time? can you test this? Try with your 20 second delay. See if you can get it to play for say, 5 minutes. If it eventually stops then it sounds like some kind of EOF issue.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (56): « Previous 1 … 36 37 38 39 40 … 56 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  Looking for C# UPnP Media Server code bgowland 5 7,743 2016-12-16, 08:25 PM
Last Post: mvallevand
  Media\Show Directory mvallevand 12 6,108 2014-07-02, 10:58 AM
Last Post: sub
  Media\Shows Metadata mvallevand 2 1,932 2013-05-22, 04:09 AM
Last Post: mvallevand
  Streaming media imilne 44 13,144 2012-12-14, 04:05 AM
Last Post: mvallevand
  SkyDrive Eplorer Integration Released.....also available for Mac and iPad UncleJohnsBand 0 1,483 2012-04-24, 01:06 AM
Last Post: UncleJohnsBand
  Building a list of files in media folders (npvr Music and Videos) bgowland 2 1,945 2012-02-05, 10:29 AM
Last Post: bgowland
  Windows Media Connect - Storing stuff on a Home Server psycik 3 2,750 2009-09-29, 03:47 AM
Last Post: mvallevand
  Plugin notification of stopped media mvallevand 7 2,404 2009-08-19, 11:16 PM
Last Post: mvallevand
  GBPVR Media Events KingArgyle 1 1,614 2005-03-27, 07:12 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode