Page 1 of 1

Play M3U file from JVLC

Posted: 22 Sep 2008 02:40
by marcsto
Hello,

I have been looking into launching playlist files (ie: M3U files) from JVLC. There are several classes related to playlists (MediaList, MediaListPlayer etc.), but it seems that these classes were created to build playlists from single files (ie: add several individual MP3's to a MediaList and play it).

Is there a way to play a M3U playlist file? I was thinking there might be a method that will split each file mp3 file inside a M3U file into MediaDescriptors or simply a function that will play all of the songs in the playlist would work as well. Does anything like this exist?

Thanks,
Marc

Re: Play M3U file from JVLC

Posted: 22 Sep 2008 17:11
by VLC_help
You should be able to open m3u as same way as any audio file. VLC should do the parsing automatically.

Re: Play M3U file from JVLC

Posted: 23 Sep 2008 07:21
by marcsto
Thanks for your fast response! :)

When I play M3U files from VLC directly, they work correctly. However, when I load them from JVLC, it doesn't start playing (I load it exactly the same way as I would load a normal mp3). I see the following in the logs:

[00000372] main input debug: thread started
[00000372] main input debug: `c:\myfile.m3u' gives access `' demux `' path `c:\myfile.m3u'
[00000372] main input debug: thread 4048 (input) created at priority 1 (input/input.c:367)
[00000372] main input debug: creating demux: access='' demux='' path='c:\myfile.m3u'
[00000373] main demux debug: looking for access_demux module: 2 candidates
[00000373] main demux debug: TIMER module_Need() : 1.000 ms - Total 1.000 ms / 1 intvls (Avg 1.000 ms)
[00000372] main input debug: creating access '' path='c:\myfile.m3u'
[00000374] main access debug: looking for access module: 6 candidates
[00000374] vcd access debug: trying .cue file: c:\myfile.cue
[00000374] vcd access debug: could not find .cue file
[00000374] access_file access debug: opening file `c:\myfile.m3u'
[00000374] main access debug: using access module "access_file"
[00000374] main access debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
[00000375] main stream debug: Using AStream*Stream
[00000375] main stream debug: pre-buffering...
[00000375] main stream debug: received first data for our buffer
[00000372] main input debug: creating demux: access='' demux='' path='c:\myfile.m3u'
[00000376] main demux debug: looking for demux module: 60 candidates
[00000376] playlist demux debug: found valid M3U playlist
[00000376] main demux debug: using demux module "playlist"
[00000376] main demux debug: TIMER module_Need() : 0.000 ms - Total 0.000 ms / 1 intvls (Avg 0.000 ms)
[00000372] main input debug: looking for a subtitle file in c:\1marc\music\
[00000372] main input debug: `c:\myfile.m3u' successfully opened
[00000372] main input debug: EOF reached
[00000372] main input debug: control type=1

Re: Play M3U file from JVLC

Posted: 23 Sep 2008 11:26
by jeroensky
Did you make the m3u file correct?
I use a simple text editor, and on every line a url to the file(or just the filename if the m3u is in same directory as the files).

like:

http://name.domain.org/data/file1.jpg
http://name.domain.org/data/file2.jpg
http://name.domain.org/data/file3.mp3
http://name.domain.org/data/file4.mp3
http://name.domain.org/data/file5.m4a

...and so on.
Save the file with extension *.m3u instead of for example txt.
More info about m3u: http://en.wikipedia.org/wiki/M3u
Maybe it's a issue of jvlc. http://trac.videolan.org/jvlc/report

Re: Play M3U file from JVLC

Posted: 23 Sep 2008 13:28
by VLC_help
You get same messages on VLC if you try to open the m3u file?

Re: Play M3U file from JVLC

Posted: 24 Sep 2008 10:05
by marcsto
The playlist plays correctly if I run it directly from vlc (by double clicking the vlc.exe icon and choosing media, open file...) . Here is the code I use to run any media file (either an MP3 or a M3U playlist). It works correctly for MP3 files but not M3U files (see the logs in my previous post). I have been thinking of upgrading to the latest version of VLC but I wasn't sure if the JVLC jar files have been updated.

Code: Select all

String[] param = new String[] { "-vvv", "--plugin-path=c:\\vlc-0.9.0-test3-20080727-0004\\plugins", "--no-plugins-cache" }; jvlc = new JVLC(param); // Setup the player with the current file to play. MediaDescriptor mediaDescriptor = new MediaDescriptor(jvlc, fileName); player = mediaDescriptor.getMediaPlayer(); // Set the default volume. Audio audio = new Audio(jvlc); audio.setVolume(DEFAULT_VOLUME); player.play();

Re: Play M3U file from JVLC

Posted: 02 Oct 2008 08:18
by marcsto
I have a temporary fix to my problem. In case anyone runs into the same issue, here's what I did:

The following thread talks about a bug in jvlc's handling of the new MediaList format.
viewtopic.php?f=2&t=49612&start=0&st=0&sk=t&sd=a

They suggest that until the problem is solved, we should revert back to using the deprecated PlayList class. This class still works and was good enough for my scenario.