Log in

View Full Version : FFMPEG and Avisynth


fabje
17th March 2014, 14:05
Is there a way to use an .avs file as an input file for FFMPEG.exe?

I saw this:
Just create an "input.avs" text file with this single line ...
DirectShowSource("C:\path to your file\yourfile.asf")
... and then feed that text file to ffmpeg:
ffmpeg -i input.avs

Here: http://www.ffmpeg.org/faq.html#How-can-I-read-DirectShow-files_003f

But when I try that I get this error: Unknown error occurred.

I have this in my input.avs:
DirectShowSource("D:\source.ts")

Anyone that can help?

poisondeathray
17th March 2014, 16:39
Yes you can if your ffmpeg.exe binary has been compiled with avisynth support

First, debug your avs script. Does it open in vdub or avspmod, and post any error messages

fabje
17th March 2014, 16:47
Yes you can if your ffmpeg.exe binary has been compiled with avisynth support

First, debug your avs script. Does it open in vdub or avspmod, and post any error messages
When I use VirtualDubMod and open the .avs file I don't get any errors.

This is ffmpeg.exe with loglevel on debug:
D:\>ffmpeg.exe -i D:\input.avs -vcodec libx264 D:\test.mkv -loglevel debug
ffmpeg version N-61286-gdbc3e11 Copyright (c) 2000-2014 the FFmpeg developers
built on Mar 11 2014 22:06:56 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --ena
ble-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger -
-enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-li
bvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 66.101 / 52. 66.101
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 34.100 / 55. 34.100
libavdevice 55. 11.100 / 55. 11.100
libavfilter 4. 3.100 / 4. 3.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'D:\input.avs'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
Reading option 'D:\test.mkv' ... matched as output file.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file D:\input.avs.
Successfully parsed a group of options.
Opening an input file: D:\input.avs.
[avisynth @ 0000000000377760] Format avisynth probed with size=2048 and score=50
[AVIOContext @ 0000000002d17ee0] Statistics: 100 bytes read, 0 seeks
D:\input.avs: Unknown error occurred

qyot27
19th March 2014, 22:19
What version(s) of AviSynth, DirectShowSource, and the decoding filters (ffdshow or LAV Filters)? Do you have the proper MSVC runtimes installed?

Although really, you should probably be using LSMASHSource to open TS files (or remux to MKV with mkvmerge and use FFMS2), not DirectShowSource.

Also, it'd be more accurate to test if x264.exe works with the script, because like x264, FFmpeg talks directly to the AviSynth library.