How to playback using playlist file as playback url?
#1
As part of the SageTV addon I'm working on, I'm trying to add support to playback playlist files to handle a situation in Sage where sometimes it splits up a recording into multiple files.

In a situation where there are multiple files associated with one recording, I'd like to use a local http URL which returns a .m3u file, but when I do that, I get the following error:
Code:
10:30:00 T:1248   ERROR: CDVDDemuxFFmpeg::Open - error probing input format, http://<URL TO MY PATH THAT RETURNS THE .M3U FILE BELOW>
10:30:00 T:1248   ERROR: CDVDPlayer::OpenDemuxStream - Error creating demuxer
10:30:00 T:1248  NOTICE: CDVDPlayer::OnExit()
10:30:00 T:1248  NOTICE: CDVDPlayer::OnExit() deleting input stream
10:30:00 T:2984   DEBUG: Thread CFileCache 2984 terminating
10:30:00 T:1248   DEBUG: Thread CDVDPlayer 1248 terminating
10:30:00 T:8160   DEBUG: CAnnouncementManager - Announcement: OnStop from xbmc
10:30:00 T:8160   DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnStop
10:30:00 T:8160   ERROR: Playlist Player: skipping unplayable item: 0, path [http://<URL TO MY PATH THAT RETURNS THE .M3U FILE BELOW>]
10:30:00 T:8160   DEBUG: Playlist Player: no more playable items... aborting playback

And here is the format of the .m3u playlist file that the playback URL returns:
Code:
#EXTM3U
smb://localhost/SageTV Recordings/CBSNewsSundayMorning-6848514-0.mpg
smb://localhost/SageTV Recordings/CBSNewsSundayMorning-6848514-1.mpg

Any thoughts on why this isn't working? Does XBMC support setting a playlist file as the URL for a listitem in the "xbmcplugin.addDirectoryItem" method?
Reply
#2
I very well may be wrong here, but the URL we are using returns a .m3u file, but is not a direct link to a .m3u file. I think this is where we are having issues. How do we retrieve that .m3u and pass it to XBMC?

I placed the api.m3u on my remote ftp site and hardcoded the link to it in our video test addon. I was able to access the playlist and play the items in the list. FYI, it did not play when I chose "play". Instead it opened the play list and then I had to choose the segment to play.
Reply
#3
(2012-10-08, 17:55)kricker Wrote: I very well may be wrong here, but the URL we are using returns a .m3u file, but is not a direct link to a .m3u file. I think this is where we are having issues. How do we retrieve that .m3u and pass it to XBMC?

I placed the api.m3u on my remote ftp site and hardcoded the link to it in our video test addon. I was able to access the playlist and play the items in the list. FYI, it did not play when I chose "play". Instead it opened the play list and then I had to choose the segment to play.

In a perfect world, XBMC would determine if the URL is a link to a playlist file (or video file) OR the playlist or video file itself and play it back from there. Is there a way to somehow tell the listitem object that it's a link to a playlist file vs. the playlist file itself (to me they are one in the same though!... one just happens to be on local PC and the other just happens to be streamed back via http).

In thinking through this more, is the only way that I can handle this to build a custom context menu item (something like "Play all segments") that I can then use XBMC's builtin playlist functions for? Seems clunky... and I would think there is a better way to be able to use XBMC's native playback.
Reply
#4
(2012-10-08, 16:31)LehighBri Wrote: And here is the format of the .m3u playlist file that the playback URL returns:
Code:
#EXTM3U
smb://localhost/SageTV Recordings/CBSNewsSundayMorning-6848514-0.mpg
smb://localhost/SageTV Recordings/CBSNewsSundayMorning-6848514-1.mpg

Any thoughts on why this isn't working? Does XBMC support setting a playlist file as the URL for a listitem in the "xbmcplugin.addDirectoryItem" method?

I'm thinking you need to escape the space in the url, %20 or something.
Reply
#5
(2012-10-09, 00:54)divingmule Wrote:
(2012-10-08, 16:31)LehighBri Wrote: And here is the format of the .m3u playlist file that the playback URL returns:
Code:
#EXTM3U
smb://localhost/SageTV Recordings/CBSNewsSundayMorning-6848514-0.mpg
smb://localhost/SageTV Recordings/CBSNewsSundayMorning-6848514-1.mpg

Any thoughts on why this isn't working? Does XBMC support setting a playlist file as the URL for a listitem in the "xbmcplugin.addDirectoryItem" method?

I'm thinking you need to escape the space in the url, %20 or something.

Nope... still doesn't worked. I renamed my folder to try a folder with no spaces and that didn't work. I stil get a "Playlist Player: skipping unplayable item: 0, path...
Reply
#6
Why not use a stack? Assuming you know the URLs, it's just:

stack://<url1> , <url2>

XBMC will then automatically play the whole lot (almost seamlessly), including having the correct time and so on.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
So are you saying we send the built in playMedia command the stack://<url1>,<url2>, ... as the source?

EDIT:
Okay using our videotest addon I hard coded the following path to send to the player:

stack://smb://PVR/Media/Recorded TV/CandiceTellsAll-S04E10-2740960-0.mpg,smb://PVR/Media/Recorded TV/CandiceTellsAll-S04E10-2740960-1.mpg

In the log I get:

23:07:06 T:1752 NOTICE: *****VIDEOTEST*****: Path passed in to PlayMedia=stack://smb://PVR/Media/Recorded TV/CandiceTellsAll-S04E10-2740960-0.mpg,smb://PVR/Media/Recorded TV/CandiceTellsAll-S04E10-2740960-1.mpg
23:07:06 T:1752 INFO: Scriptresult: Success
23:07:06 T:1752 INFO: Python script stopped
23:07:06 T:1752 DEBUG: Thread XBPyThread 1752 terminating
23:07:06 T:812 DEBUG: waiting for python thread 9 to stop
23:07:06 T:812 DEBUG: python thread 9 destructed
23:07:07 T:1108 DEBUG: CVideoDatabase::RunQuery took 63 ms for 10 items query: select * from episodeview ORDER BY dateAdded desc, idEpisode desc LIMIT 10
23:07:07 T:812 DEBUG: CAnnouncementManager - Announcement: OnClear from xbmc
23:07:07 T:812 DEBUG: GOT ANNOUNCEMENT, type: 2, from xbmc, message OnClear
23:07:07 T:1344 DEBUG: CThumbExtractor:Big GrinoWork - trying to extract filestream details from video file smb://TOWER/TV/Curiosity/Curiosity - 2x01 - Plane Crash.mkv
23:07:07 T:1344 DEBUG: SECTION:LoadDLL(special://xbmcbin/system/players/dvdplayer/avutil-51.dll)
23:07:07 T:1344 DEBUG: SECTION:LoadDLL(special://xbmcbin/system/players/dvdplayer/avcodec-53.dll)
23:07:07 T:1344 DEBUG: SECTION:LoadDLL(special://xbmcbin/system/players/dvdplayer/avformat-53.dll)
23:07:07 T:1344 DEBUG: CDVDDemuxFFmpeg::Open - probing detected format [matroska,webm]
23:07:07 T:1344 DEBUG: CDVDDemuxFFmpeg::Open - avformat_find_stream_info starting
23:07:07 T:812 DEBUG: Trying to connect to \\PVR\Media with username(karl) and password(XXXX)
23:07:07 T:812 ERROR: CWINFileSMB: Unable to open file \\PVR\Media\Recorded TV\CandiceTellsAll-S04E10-2740960-0.mpg,smb:\\PVR\Media\Recorded TV\CandiceTellsAll-S04E10-2740960-1.mpg Error: 161
23:07:07 T:812 ERROR: XBMC.PlayMedia could not play media: stack://smb://PVR/Media/Recorded TV/CandiceTellsAll-S04E10-2740960-0.mpg,smb://PVR/Media/Recorded TV/CandiceTellsAll-S04E10-2740960-1.mpg
23:07:07 T:1344 DEBUG: CDVDDemuxFFmpeg::Open - av_find_stream_info finished


Python code used:

if(args[0] == "watchnow"):
xbmc.executebuiltin("Notification(Attempting playback)")
#strPathForPlayMedia = args[1]
strPathForPlayMedia = "stack://smb://PVR/Media/Recorded TV/CandiceTellsAll-S04E10-2740960-0.mpg,smb://PVR/Media/Recorded TV/CandiceTellsAll-S04E10-2740960-1.mpg"
print "*****VIDEOTEST*****: Path passed in to PlayMedia=" + strPathForPlayMedia
xbmc.executebuiltin('PlayMedia("%s")' % strPathForPlayMedia)
Reply
#8
I can send:

stack://smb://PVR/Media/Recorded TV/CandiceTellsAll-S04E10-2740960-0.mpg

... in the above code and the file plays perfectly fine. I must be structuring the stack:// wrong somehow.

EDIT:
I even tried using a stack URL from my database:

stack://C:\Users\karl\Desktop\test-files\Movies\Cars\Cars -part1.mp4 , C:\Users\karl\Desktop\test-files\Movies\Cars\Cars -part2.mp4

Log results:

00:13:53 T:4668 NOTICE: *****VIDEOTEST*****: Path passed in to PlayMedia=stack://C:\Users\karl\Desktop est-files\Movies\Cars\Cars -part1.mp4 , C:\Users\karl\Desktop est-files\Movies\Cars\Cars -part2.mp4
00:13:53 T:4668 INFO: Scriptresult: Success
00:13:53 T:4668 INFO: Python script stopped
00:13:53 T:4668 DEBUG: Thread XBPyThread 4668 terminating
00:13:53 T:2280 DEBUG: waiting for python thread 9 to stop
00:13:53 T:2280 DEBUG: python thread 9 destructed
00:13:53 T:2280 DEBUG: CAnnouncementManager - Announcement: OnClear from xbmc
00:13:53 T:2280 DEBUG: GOT ANNOUNCEMENT, type: 2, from xbmc, message OnClear
00:13:53 T:2280 ERROR: XBMC.PlayMedia could not play media: stack://C:\Users\karl\Desktop est-files\Movies\Cars\Cars -part1.mp4 , C:\Users\karl\Desktop est-files\Movies\Cars\Cars -part2.mp4
00:13:53 T:4636 DEBUG: CAESinkDirectSound:Big Grineinitialize: Cleaning up
Reply
#9
space comma space between items.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
(2012-10-09, 07:41)jmarshall Wrote: space comma space between items.

I tried with the following and get an error (notice that it replaces the b in "blahh" with a special looking character for some reason (perhaps it's a delimiter issue?):

URL:
stack://C:\blahh\CBSNewsSundayMorning-6848514-0.mpg , C:\blahh\CBSNewsSundayMorning-6848514-0.mpg

Error:
08:17:39 T:4668 DEBUG: CGUIWindowVideoBase::OnPlayMedia stack://C:lahh\CBSNewsSundayMorning-6848514-0.mpg , C:lahh\CBSNewsSundayMorning-6848514-0.mpg
08:17:39 T:4668 DEBUG: CAnnouncementManager - Announcement: OnClear from xbmc
08:17:39 T:4668 DEBUG: GOT ANNOUNCEMENT, type: 2, from xbmc, message OnClear
08:17:39 T:4668 DEBUG: CAnnouncementManager - Announcement: OnAdd from xbmc
08:17:39 T:4668 DEBUG: GOT ANNOUNCEMENT, type: 2, from xbmc, message OnAdd
08:17:39 T:4668 ERROR: Playlist Player: skipping unplayable item: 0, path [stack://C:lahh\CBSNewsSundayMorning-6848514-0.mpg , C:lahh\CBSNewsSundayMorning-6848514-0.mpg]
08:17:39 T:4668 DEBUG: Playlist Player: no more playable items... aborting playback
08:17:39 T:7980 NOTICE: Thread Background Loader start, auto delete: false
08:17:39 T:7980 ERROR: XFILE::CDirectory::GetDirectory - Error getting C:lahh\
08:17:39 T:7560 DEBUG: CThumbExtractor:Big GrinoWork - trying to extract thumb from video file C:lahh\CBSNewsSundayMorning-6848514-0.mpg
08:17:39 T:7560 ERROR: InputStream: Error opening, C:lahh\CBSNewsSundayMorning-6848514-0.mpg

(2012-10-09, 14:19)LehighBri Wrote:
(2012-10-09, 07:41)jmarshall Wrote: space comma space between items.

I tried with the following and get an error (notice that it replaces the b in "blahh" with a special looking character for some reason (perhaps it's a delimiter issue?):

Success!... it indeed was a delimiter issue (you have to use \\ instead of \)... if I use the URL below, the stack:// approach works! Huge thanks!!!

stack://C:\\blahh\\CBSNewsSundayMorning-6848514-0.mpg , C:\\blahh\\CBSNewsSundayMorning-6848514-1.mpg

Many thanks jmarshall!
Reply
#11
That works for local, what about smb:// paths?

EDIT:
I just did a quick test and it works with single \ as well. smb:// paths work as well. The <space>,<space> was the trick.

stack://smb://Goliath/Downloads/Cars/Cars-part1.mp4 , smb://Goliath/Downloads/Cars/Cars-part2.mp4
Reply
#12
Note that paths with comma's in them need to add a second comma (i.e. each , becomes ,,) before they're combined.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#13
Good to know. Thanks jmarshall. The stack is working great for our addon now.
Reply

Logout Mark Read Team Forum Stats Members Help
How to playback using playlist file as playback url?0