Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th November 2013, 00:40   #1  |  Link
lisztfr9
Registered User
 
Join Date: Apr 2010
Posts: 175
Play flv and mp4 files in the same script

Hi all,

It seems hard to me open flv and mp4 files and play them in the same script like :

Code:
a = DirectShowSource("file_1.flv").BicubicResize(540,360)

b = DirectShowSource("file_2.flv").BicubicResize(540,360)

c = DirectShowSource("file_3.mp4").BicubicResize(540,360)

last = a + b + c 

Sharpen(last, 0.50)

ConvertToRGB(last)
In MPC and Virtualdub, the mp4 file will turn into grey. This mp4 plays fine in VLC. I read that DirectShowSource is the main path to go for opening an .mp4 file, so what should i try next ?

The sound is ok by-the-way.

Thanks a lot, L
lisztfr9 is offline   Reply With Quote
Old 29th November 2013, 09:52   #2  |  Link
lisztfr9
Registered User
 
Join Date: Apr 2010
Posts: 175
ffmpegsource

ffmpegsource loads the video stream nicely :

LoadPlugin("Location\ffms2.dll")
video = ffvideosource("file.mp4")
audio = ffaudiosource("file.mp4")
AudioDub(video, audio)

Solved, thanks !
lisztfr9 is offline   Reply With Quote
Old 29th November 2013, 10:09   #3  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,442
Since FFVideoSource() does not index the audio, FFAudioSource() will have to remake the index if called after FFVideoSource(). Therefore, it is faster to open the audio first.
This can be quite significant for large source files.

audio = ffaudiosource("file.mp4")
video = ffvideosource("file.mp4")
AudioDub(video, audio)

or use the FFmpegSource2() convenience function (from ffms2.avsi) which does it all for you:

FFmpegSource2("file.mp4", atrack=-1)
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 29th November 2013, 13:23   #4  |  Link
lisztfr9
Registered User
 
Join Date: Apr 2010
Posts: 175
ffmpegsource2

ffmpegsource2 works fine, thanks Gavino

Now i can watch The trespasser (1929) entirely...
lisztfr9 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:52.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.