On Wed, Mar 14, 2012 at 11:38 AM, Ertan Deniz <[email protected]> wrote:
> Hello,
>
> I'm trying to encode a video and an mp3 file so that the video sound is 
> replaced with the audio file.
>
> The following is basically how I call MLT from Java. The problem is that the 
> encoding completes successfully but the resulting video is not the full 
> video. It's shorter, like the original video is 20 seconds, the result is 15 
> seconds and it does not contain all the footage.
>

Does it work in melt?

> What can be the problem here? Am I using the framework wrong?
>
> Thanks,
> -Ertan
>
>
>        Properties prop = new Properties();
>        prop.set("description", "Medium");
>        prop.set("frame_rate_num", "15");
>        prop.set("frame_rate_den", "1");
>        prop.set("width", "320" );
>        prop.set("height", "240" );
>        prop.set("progressive", "1");
>        prop.set("sample_aspect_num", "1");
>        prop.set("sample_aspect_den", "1");
>        prop.set("display_aspect_num", "4");
>        prop.set("display_aspect_den", "3");
>        prop.set("colorspace", "601");
>
>        mProfile = new Profile(prop);
>        mVideoPlayList = new Playlist();
>        mAudioPlayList = new Playlist();
>        mTractor = new Tractor();
>        mMultiTrack = mTractor.multitrack();
>        mAudioPlayList.set("a_track", 0);
>        mAudioPlayList.set("b_track", 1);
>        mMultiTrack.connect(mVideoPlayList, 0);
>        mMultiTrack.connect(mAudioPlayList, 1);
>
>        Producer producer = new Producer(mProfile, "path/to/audio.mp3");
>        mAudioPlayList.append(producer);
>
>        Producer producer = new Producer(mProfile, "path/to/video.mp4");
>        mVideoPlayList.append(producer);
>
>        mAudioPlayList.set_in_and_out(0, mVideoPlayList.get_playtime() - 1);
>        mTractor.set_in_and_out(0, mVideoPlayList.get_playtime() - 1);
>        mTractor.seek(0);
>
>        // Create the consumer
>        mConsumer = new Consumer(mProfile, "avformat", newFileName);
>        mConsumer.connect(mTractor);
>        mConsumer.start();
>
-- 
+-DRD-+

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Mlt-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to