NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 46 47 48 49 50 … 93 Next »
MVP mp3 file size problem

 
  • 0 Vote(s) - 0 Average
MVP mp3 file size problem
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#1
2007-01-17, 08:53 AM
I'm trying to get my plugin to play audio streams on a MediaMVP (any stream, not just Shoutcast). I'm transcoding the stream to an mp3 file and then using the GB-PVR audio player to play the file while it's being recorded. This works fine on a standard GB-PVR instance but, when I try to use an MVP for playback, it plays for a few seconds and then stops.

From the log, it looks as if the GB-PVR MVP dongle code is retrieving the file size when it starts to play the file (and the file has only been recorded to for a few seconds). It then plays the file until it has read that many bytes and then stops playing. The regular audio playback code doesn't seem to need to know the size of the file. It just plays it until there's no more file to play.

Is there a work-around for this? I can't see any way to tell the MVP code to ignore the file-size or even a way to access (or set) the file size variable before or during playback.
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
HtV
Offline

Posting Freak

Posts: 3,470
Threads: 46
Joined: Dec 2005
#2
2007-01-17, 07:28 PM
Of course there is a way, however I don't know it:p . But when you listen to internet-radio it does what you want. It creates a growing mp3 file and that is being played back by the mvp. Maybe this helpsSad.
AMD Athlon 64 3000, HDD: 80, 120, 200 GB, Hauppauge 350 + 150, MVP, Asus 6000L Laptop client, Asus X50sl client,
Fritz!box 7140 modem/router, GBPVR 1.3.7.
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#3
2007-01-18, 01:04 PM
HtV Wrote:Of course there is a way, however I don't know it:p . But when you listen to internet-radio it does what you want. It creates a growing mp3 file and that is being played back by the mvp. Maybe this helpsSad.
After a bit more testing and getting the mp3 to play for a few more seconds, it turns out that the MVP playback is changing its file size number as the file grows. But then it catches up, asks for more bytes than are available and gives up.

Code:
1/18/2007 1:51:08 AM.734    VERBOSE    [16]    Request 2000 bytes (file size:125387   file location: 120000)
1/18/2007 1:51:08 AM.765    VERBOSE    [15]    MVP data read: 1   (9)
1/18/2007 1:51:08 AM.765    VERBOSE    [15]    MVP request processed
1/18/2007 1:51:08 AM.859    VERBOSE    [16]    Request 2000 bytes (file size:125387   file location: 122000)
1/18/2007 1:51:08 AM.890    VERBOSE    [15]    MVP data read: 1   (9)
1/18/2007 1:51:08 AM.890    VERBOSE    [15]    MVP request processed
1/18/2007 1:51:08 AM.984    VERBOSE    [16]    Request 2000 bytes (file size:125387   file location: 124000)
1/18/2007 1:51:08 AM.984    VERBOSE    [16]    Not all bytes read. Got:1387  Filesize now:125387
1/18/2007 1:51:08 AM.984    VERBOSE    [16]    End of stream
So it looks like VLC isn't transcoding the stream fast enough for the MVP (playback on the PC works fine). Probably Net Radio doesn't suffer from the same problem because the Shoutcast streams are already in mp3 format so don't need transcoding. I'm just guessing.

I'm running a 2.2ghz P4, which I imagine is an average system for most MVP users, so just throwing more horse power at the problem doesn't seem like a sensible option. I've heard that VLC's mp3 encoding isn't very fast. Maybe I should try one of the "fast" versions of LAME instead.

In any case, thanks for the "tea and sympathy. Smile
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
HtV
Offline

Posting Freak

Posts: 3,470
Threads: 46
Joined: Dec 2005
#4
2007-01-18, 02:48 PM
I find it hard to believe that vlc can't keep up on your system. I can encode mp3's on my system (slower than yours) at ~10x. with lame. Depends on the settings.

Edit: but I didn't try with vlc:o
AMD Athlon 64 3000, HDD: 80, 120, 200 GB, Hauppauge 350 + 150, MVP, Asus 6000L Laptop client, Asus X50sl client,
Fritz!box 7140 modem/router, GBPVR 1.3.7.
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#5
2007-01-19, 01:31 AM
HtV Wrote:I find it hard to believe that vlc can't keep up on your system. I can encode mp3's on my system (slower than yours) at ~10x. with lame. Depends on the settings.

Edit: but I didn't try with vlc:o
Well, once it gets started, it can keep up fine. I noticed that, if I started the recording and then started playing the mp3 from Music Library (while the mp3 was still growing), it played OK on the MVP. Turns out the time it took me to navigate the GB-PVR menus to get to Music Library was making the difference. I upped my delay time between starting the VLC transcoding process and starting the audio player and now it works absolutely fine. Problem solved. The delay time isn't ideal for rapid channel surfing but, presumably, MVP users are used to fairly sluggish channel changes.

Now, if I could only figure out how to detect when the user has stopped the audio player, I'd be a really happy camper. (There doesn't seem to be an audio equivalent of GetActiveVideoPlayer().isCurrentlyShowingVideo).
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,671
Threads: 767
Joined: Nov 2003
#6
2007-01-21, 12:56 AM
It doesnt normally cope with music files that are still growing. There is some special case logic that is applied when the app nows its listening to a net radio stream.

I could probably add some API for you if this is needed?
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#7
2007-01-21, 09:51 AM
sub Wrote:It doesnt normally cope with music files that are still growing. There is some special case logic that is applied when the app nows its listening to a net radio stream.
Well, it seems to be doing a pretty good job of it all the same. Audio playback on the MVP while VLC is writing the mp3 is working quite well for me provided I allow a fairly hefty delay between starting the transcoding process and starting playback. I read in a post by you a while back that having "gbnetradio" in the filename would trigger some special logic for this situation. I'm doing that, just to be on the safe side, but it seems to work OK without it. (By the same token, I'm also crossing my fingers and avoiding walking under ladders. Smile )

Quote:I could probably add some API for you if this is needed?
That would be excellent, if you have time. My two biggest needs on this front are:

a) Some way to know when the video player has stopped playing on the MVP. I curently check GetActiveVideoPlayer() and, if it returns null, I know that the user stopped the player or that a bad thing happened to it, so I kill my recording process. This works fine using a standard GB-PVR instance on the PC but doesn't seem to work at all when using the MVP dongle.

b) A way to know if the audio player has died. Similar to a) except that I do know if the user terminates the player because I'm processing the stop keystroke myself. But I still don't know if the player simply failed for some reason. It doesn't throw an exception that I can catch because no "hard" error occurred. This typically happens when the delay time before playing is not big enough. The player sees no more data in the file and says "OK - I'm done". But since my code has no way to know that the player is no longer playing the file, it lets the transcoding process continue merrily recording to the mp3 file ad infinitum. I've considered using GetAudioPlaylist() to see if the list is empty but I'm note sure if that's a totally reliable way to go about it.

If PluginHelper had a couple of methods such as bool IsAudioFilePlaying() and bool IsVideoFilePlaying(), both of which would return the correct result whether the playback was via the standard interface or via the MVP dongle code, I'd be in fat city.

I'd really appreciate some help on these two issues. Thanks in advance.
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#8
2007-01-25, 12:44 AM (This post was last modified: 2007-01-25, 01:08 AM by ubu.)
I now have code which catches all the situations I described in the previous post except one:

I'm using a call to PluginHelper's GetAudioPlaylist to check if an audio file is currently being played. (If the playbackPosition returned is zero, I assume the file is not being played, so kill the process that's recording to the file.) When playing the file using standard GB-PVR (non-MVP) this returns correct values for the trackDuration and playbackPosition parameters. However, when the MVP is doing the playback, GetAudioPlaylist always returns zero in all its parameters, whether the file is being played or not. Sad

This is wierd because a) the MVP responds to other audio-related methods (eg. PausePlaylist) and b) I see other plugins using GetAudioPlaylist where they clearly expect it to work in the MVP case (MVP Music Box, for instance). Any ideas?

I haven't got an answer from sub yet on whether he might expose explicit methods for checking stuff like this. I know he's been out of town so may not have seen my previous post.
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,671
Threads: 767
Joined: Nov 2003
#9
2007-01-25, 01:44 AM
Quote:I'm using a call to PluginHelper's GetAudioPlaylist to check if an audio file is currently being played. (If the playbackPosition returned is zero, I assume the file is not being played, so kill the process that's recording to the file.) When playing the file using standard GB-PVR (non-MVP) this returns correct values for the trackDuration and playbackPosition parameters. However, when the MVP is doing the playback, GetAudioPlaylist always returns zero in all its parameters, whether the file is being played or not.
Unfortunately this is normal. GB-PVR doesnt know the playback position or duration of audio files playing on the MVP, so you just need to keep this in mind when designing any screens.

Quote:I haven't got an answer from sub yet on whether he might expose explicit methods for checking stuff like this. I know he's been out of town so may not have seen my previous post.
Sorry, I have got this thread on my list of things to revisit soon, but havnt managed to get to it yet.
ubu
Offline

Posting Freak

Posts: 792
Threads: 54
Joined: Jan 2006
#10
2007-01-25, 11:39 AM
sub Wrote:Unfortunately this is normal. GB-PVR doesnt know the playback position or duration of audio files playing on the MVP, so you just need to keep this in mind when designing any screens.
Well actually, that's not a problem since I don't much care about the duration or playback position. I just want to know if the bugger is playing at all! Is there any way that GB-PVR can know if the MVP is currently playing an audio file or even if the playlist is empty?

In the log, I see messages such as "End of stream", "MVP Streaming Server received STOP message" and "Song ended. Checking if there are more songs to play" but I don't know who's writing them to the log. I guess I was hoping they meant that GB-PVR did know when these events had happened.

If not, since the PluginHelper has the API available to move about in the playlist (NextPlaylistTrack, PrevPlaylistTrack, etc.) and to detect if the playlist is paused, I though there might be a way to know if it's empty (assuming that the MVP encountering the end of the only item in the list would equate to "empty").

Quote:Sorry, I have got this thread on my list of things to revisit soon, but havnt managed to get to it yet.
That's cool. I've pretty much come up with workarounds for everything except this MVP audio playback detection thing, so you can more or less ignore what I said in the earlier posts. However, if, at some point, you could provide an IsAudioFilePlaying() method that worked for both MVP and non-MVP cases, I'd be a very happy camper.
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]

Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  How Does "Use S01E01 File naming format if possible" work puck64 7 5,296 2015-08-25, 10:21 AM
Last Post: puck64
  NEWA - using buffer file produced by /public/VLCService?Channel= bgowland 5 2,783 2014-01-02, 06:36 AM
Last Post: bgowland
  Is the input file for pvrx2.exe -import unique to NextPVR? spinnaker 1 1,765 2013-10-08, 02:25 AM
Last Post: sub
  Accessing music file metadata in C# bgowland 6 3,270 2013-01-26, 05:14 AM
Last Post: bgowland
  Problem with preview image for Pending Recordings Northpole 2 1,978 2012-08-14, 02:56 AM
Last Post: Northpole
  ActivatePopup: SSPlus problem ACTCMS 10 4,712 2012-07-18, 09:43 PM
Last Post: ACTCMS
  Weird Code problem - serialisation (I'll spell it the proper way!!"0 psycik 22 6,094 2011-11-25, 03:16 AM
Last Post: whurlston
  Resolving required plugin assemblies problem McBainUK 37 11,973 2011-10-26, 06:12 PM
Last Post: psycik
  File browsing - a big ask imilne 3 1,984 2010-11-04, 09:03 PM
Last Post: imilne
  Actual size of inner element in NPVR scb147 2 1,750 2010-11-02, 06:40 PM
Last Post: scb147

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

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

Linear Mode
Threaded Mode