LibVLC and playing a byte array in memory

This forum is about all development around libVLC.
ddebugit
New Cone
New Cone
Posts: 2
Joined: 19 Dec 2010 02:21

LibVLC and playing a byte array in memory

Postby ddebugit » 19 Dec 2010 02:32

First off, I want to say "thank you" for such an amazing product.

Now, I noticed that libVLC (since 1.1.0) has:
* New memory input (imem) access and access_demux module to feed VLC from data in memory
I'm currently using v1.1.5. I've had success using the VLC API documented here to load a video file on disc (HDD) and play it. I've also implemented features of playing/pausing/stopping/changing the volume/and adding a logo to a video. I'm programming in C# (I created my own wrapper for libVLC [I couldn't find one that supported the latest release]).

I've searched for a couple of hours on some documentation for "imem". The best I got was:
Memory input
--imem-caching=<integer> Caching value in ms
Caching value for imem streams. This value should be set in
milliseconds.
--imem-get=<string> Get function
Address of the get callback function
--imem-release=<string> Release function
Address of the release callback function
--imem-cookie=<string> Callback cookie string
Text identifier for the callback functions
--imem-data=<string> Callback data
Data for the get and release functions
--imem-id=<integer> ID
Set the ID of the elementary stream
--imem-group=<integer> Group
Set the group of the elementary stream
--imem-cat={0 (Unknown), 1 (Audio), 2 (Video), 3 (Subtitle), 4 (Data)}
Category
Set the category of the elementary stream
--imem-codec=<string> Codec
Set the codec of the elementary stream
--imem-language=<string> Language
Language of the elementary stream as described by ISO639
--imem-samplerate=<integer>
Sample rate
Sample rate of an audio elementary stream
--imem-channels=<integer> Channels count
Channels count of an audio elementary stream
--imem-width=<integer> Width
Width of video or subtitle elementary streams
--imem-height=<integer> Height
Height of video or subtitle elementary streams
--imem-dar=<string> Display aspect ratio
Display aspect ratio of a video elementary stream
--imem-fps=<string> Frame rate
Frame rate of a video elementary stream
Is there any more documentation regarding this feature? Am I supposed to use these parameters with libvlc_new()? Is there a "better" way of doing this by invoking an API (if so; what is the API)?

Any help is much appreciated. Thanks!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: LibVLC and playing a byte array in memory

Postby Jean-Baptiste Kempf » 19 Dec 2010 11:40

unfortunately, the best way is to load the imem:// object like this

imem:// :imem-codec= :imem-get= etc...

Like you would load a dvd:// file
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

ddebugit
New Cone
New Cone
Posts: 2
Joined: 19 Dec 2010 02:21

Re: LibVLC and playing a byte array in memory

Postby ddebugit » 19 Dec 2010 17:47

unfortunately, the best way is to load the imem:// object like this

imem:// :imem-codec= :imem-get= etc...

Like you would load a dvd:// file
Thank you very much for the quick reply.

I was using imem as command line parameters for libvlc_new(argc, argv), previously, as well as "fake://" for the URL in libvlc_media_new_location(instance, URL). It seemed to be working (I was getting callbacks on lock and unlock), however, the video was never played. I didn't quite understand the purpose of "lock" and "unlock" (e.g. what code am I supposed to have in there?). Maybe you can explain that to me. The description doesn't really tell me what needs to be there.

I will try using imem:// for use in the URL in libvlc_media_new_location(). I'll also get on IRC to see if I can get some help with this matter.

Thanks again.

mabarak
New Cone
New Cone
Posts: 1
Joined: 05 Jan 2011 15:53

Re: LibVLC and playing a byte array in memory

Postby mabarak » 05 Jan 2011 15:58

Where you able to use the imem?
Can you provide an example what are the arguments and the url you used?

Thanks

eduard
New Cone
New Cone
Posts: 2
Joined: 19 Jan 2011 13:35

Re: LibVLC and playing a byte array in memory

Postby eduard » 20 Jan 2011 11:59

Can someone give me some points regaring this topic? I posted a related question at: viewtopic.php?f=32&t=86533&e=0


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 16 guests