[vlc-devel] Re: Java APIs for VLC

Kuldipsingh Pabla Kuldipsingh.Pabla at Sun.COM
Wed Apr 12 02:08:17 CEST 2006


Hi All,

First of all, I would like to thank dionoea (pardon me I know you only 
by this name).

With dionoea's help, I was able to add options to playlist_add call to 
pass on options. The function calls libvlc_playlist_add if the options== 
NULL else calls _add_extended with options. With these changes, now, I 
can display and transcode in SwingClient.

While making these changes, looking at the src/control/playlist.c:33, I 
found that _play doesn't handle options ;( Is there a plan to implement 
the code to handle play time options?

-Kuldip

Kuldipsingh Pabla wrote:
> Hi Filippo,
> 
> This is a good example. And I still need more hand holding from you. 
> What I would like to do is while playing a clip inside "SwingClient", I 
> would like to transcode it to mp4. For this, here is what I am looking 
> for to do:
> 
> 1) Enter mpeg2 clip name in the little text window - say test.mpeg2
> 2) Play the clip &
> 3) transcode it to mpeg4 and save it as a different file name  - say 
> test.mp4.
> 4) Repeat (1) thru (3) with a new mpeg2 clip name.
> 
> All I would like to know is how to do it pro grammatically - set the 
> names of mpeg2 files and mpeg4 files once the client is launched and 
> transcode.
> 
> Meanwhile, my changes helps me compile and run it on Solaris10 too. I 
> would guess, it it generic enough to run on any Unix/Linux platform.
> 
> Thanx in advance,
> 
> -Kuldip
> 
> Filippo Carone wrote:
> 
>> Kuldipsingh Pabla ha scritto:
>>
>>> Now, I have a question. If I want to do transcoding while playing a
>>> clip, how do I do it using your Java API? Do you have any samples? My
>>> intention is play a clip and transcode into an mpg4 file (from mpeg2).
>>> I'll greatly appreciate your help.
>>
>>
>>
>> First of all update jvlc from
>> http://www.carone.org/publicsvn/jvlc/jvlc-trunk svn repository, since I
>> fixed a bug to make this work properly.
>>
>> Here is the sample code:
>>
>> public class VLC {
>>
>>     public static void main(String args[]) {
>>         JVLC jvlc = new JVLC(args);
>>         System.out.println(jvlc.playlist.itemsCount());
>>         jvlc.playlist.play(-1, null);
>>         try {
>>             Thread.sleep(10000);
>>         } catch (InterruptedException e) {
>>             // TODO Auto-generated catch block
>>             e.printStackTrace();
>>         }
>>         System.out.println(".END.");
>>     }
>>
>> }
>>
>> As you can see, the JVLC class takes a String[] array, which contains
>> the cmd line. If you run it in this way:
>>
>> java -Djava.library.path=. VLC myfile.avi --sout
>> "#transcode{vcodec=mp4v,vb=$bitrate,scale=1,acodec=mpga,ab=192,channels=2}:duplicate{dst=std{access=file,mux=ogg,dst='file.avi'}}" 
>>
>>
>> it will transcode the myfile.avi file in a file.avi ogg file. Now focus
>> on these lines:
>>
>>         try {
>>             Thread.sleep(10000);
>>         } catch (InterruptedException e) {
>>             // TODO Auto-generated catch block
>>             e.printStackTrace();
>>         }
>>
>> These mean vlc will run for 10secs, since the JVLC object does not wait
>> for the playlist thread to end its tasks. If you use a GUI this problem
>> doesn't show up, since the JVLC object presumably has the same lifespan
>> of the main window.
>>
>> This sample anyway shows that you can use JVLC with the same command
>> line of vlc expecting the same result.
>>
>> Let me know if there are problems running it in this way,
>> cheers,
>> filippo
>>
> 

-- 
Project Buz :: Orchestrated Communication :: http://software.sfbay/buz

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list