View Full Version : Play flv and mp4 files in the same script


lisztfr9
29th November 2013, 00:40
Hi all,

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



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
29th November 2013, 09:52
ffmpegsource loads the video stream nicely :

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

Solved, thanks !

Gavino
29th November 2013, 10:09
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)

lisztfr9
29th November 2013, 13:23
ffmpegsource2 works fine, thanks Gavino :)

Now i can watch The trespasser (1929) entirely...