Exporting with IN and OUT

About encoding, codec settings, muxers and filter usage
Gawain
Blank Cone
Blank Cone
Posts: 31
Joined: 08 Jan 2009 11:38
VLC version: 0.9.8a - 1.0.0
Operating System: Windows XP

Exporting with IN and OUT

Postby Gawain » 21 Jul 2009 14:30

I'm new at streaming with VLC but I was wondering if it is possible to export/stream a section of a video to a file by setting IN and OUT. I'm developing a software where I want to cut out different parts of a video and create a new file with only that parts. What would be the best way to do that using JVLC?
Thanks a lot for helping me!

thannoy
Big Cone-huna
Big Cone-huna
Posts: 601
Joined: 20 Mar 2008 09:44
VLC version: 0.9.8a & 1.0-git
Operating System: GNU/Linux Fedora10
Location: France
Contact:

Re: Exporting with IN and OUT

Postby thannoy » 21 Jul 2009 16:45

Note: I don't know about jvlc bindings, this is a more general idea based on VLC usages.

You can try to stream a playlist to a file with start-time and run-time or stop-time for each item.

Idea is as follow:
- add foo.ts with options :start-time=5 :stop-time=9
- add foo.ts with options :start-time=17 :stop-time=50
- add foo.ts with options :start-time=54 :stop-time=90

And sout all the playlist to a file (maybe giving this sout parameter to libvlc_new if you can do it with jvlc)
--sout=file/ts://output.ts

The same using a command line would be like this (for Linux):

Code: Select all

# Here, vlc will also quit when the work is done vlc --sout file/ts://output.ts foo.ts :start-time=5 :stop-time=9 foo.ts :start-time=17 :stop-time=50 ... vlc://quit
But I'm afraid that "--start-time" option is bugous (it was in summer '08 iirc) and does nothing. Hope it is no more the case.
If it is the case, inform about and I will create a ticket on the bug tracker.

Gawain
Blank Cone
Blank Cone
Posts: 31
Joined: 08 Jan 2009 11:38
VLC version: 0.9.8a - 1.0.0
Operating System: Windows XP

Re: Exporting with IN and OUT

Postby Gawain » 22 Jul 2009 11:15

thanks for your help and the hint for using a playlist. I will try that out later!

Now I'm trying to find out where to put the start-time and stop-time in the option-string in JVLC. Has anyone used that before?
This is my current code, but it dosn't work :-(

Code: Select all

JVLC jvlc = new JVLC(JVLC_PARAMS); MediaDescriptor mediaDescriptor = new MediaDescriptor(jvlc, getPath()); mediaDescriptor.addOption(":sout=#duplicate{dst=std{access=file,dst=" + this.path + "}}:start-time=100:stop-time=1000"); MediaPlayer player = mediaDescriptor.getMediaPlayer(); player.play();

thannoy
Big Cone-huna
Big Cone-huna
Posts: 601
Joined: 20 Mar 2008 09:44
VLC version: 0.9.8a & 1.0-git
Operating System: GNU/Linux Fedora10
Location: France
Contact:

Re: Exporting with IN and OUT

Postby thannoy » 22 Jul 2009 11:45

give this a try (adding spaces):

Code: Select all

JVLC jvlc = new JVLC(JVLC_PARAMS); MediaDescriptor mediaDescriptor = new MediaDescriptor(jvlc, getPath()); mediaDescriptor.addOption(":sout=#duplicate{dst=std{access=file,dst=" + this.path + "}} :start-time=100 :stop-time=1000"); MediaPlayer player = mediaDescriptor.getMediaPlayer(); player.play();
NB1: start/stop time are in seconds from the beginning of the media.
NB2: Maybe a --sout-keep will be needed as a global VLC option to append the result in output file instead of overwriting it for each media.

Gawain
Blank Cone
Blank Cone
Posts: 31
Joined: 08 Jan 2009 11:38
VLC version: 0.9.8a - 1.0.0
Operating System: Windows XP

Re: Exporting with IN and OUT

Postby Gawain » 22 Jul 2009 11:51

no, it's still exporting the whole video.

Gawain
Blank Cone
Blank Cone
Posts: 31
Joined: 08 Jan 2009 11:38
VLC version: 0.9.8a - 1.0.0
Operating System: Windows XP

Re: Exporting with IN and OUT

Postby Gawain » 02 Sep 2009 12:27

@thannoy: I tried to export several section of one video just like you've told be. Either in Java but also with the command line. In both ways it only exports the last section I'm setting. I seams that the sections before are ignored or overwritten. It also only uses the start-time and doesn't really stop the export. Do you have any idea how to work around that problem?


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 4 guests