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. |
14th November 2015, 06:18 | #1 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,560
|
Encoding AVS Script with FFMPEG
I've been encoding AVS scripts with x264.exe successfully. Now I'm trying to do so with FFMPEG, since it contains x264.
Here's my command ffmpeg -i Source.avs -c:v libx264 -preset veryslow -crf 24 "Output.264" Here's the output. What's going on here? Code:
ffmpeg version N-76637-gedd0c1d Copyright (c) 2000-2015 the FFmpeg developers built with gcc 5.2.0 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-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-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 5.100 / 55. 5.100 libavcodec 57. 15.100 / 57. 15.100 libavformat 57. 14.100 / 57. 14.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 15.100 / 6. 15.100 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 F:\NaturalGrounding\Temp\Job1_Script.avs: Unknown error occurred |
14th November 2015, 07:28 | #2 | Link |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,445
|
That points to a bad install or some other situation where FFmpeg can't see that AviSynth is installed. That's exactly the error I get here when I rename AviSynth.dll to AviSynth.dll.bak so that FFmpeg can't load it.
If it was an incorrect version it would tell you because the interface version check would fail and print an error message, and if it was a plugin or other internal issue then it'd be reported like any other demuxer message FFmpeg reports [avisynth @ address] message from FFmpeg or AviSynth. Code:
>ffmpeg -v 9 -loglevel 99 -i test.avs ffmpeg version N-76642-g2f90197 Copyright (c) 2000-2015 the FFmpeg developers built on Nov 11 2015 14:14:43 with gcc 5.2.0 (GCC) libavutil 55. 5.100 / 55. 5.100 libavcodec 57. 15.100 / 57. 15.100 libavformat 57. 14.100 / 57. 14.100 libavdevice 57. 0.100 / 57. 0.100 libavfilter 6. 15.100 / 6. 15.100 libavresample 3. 0. 0 / 3. 0. 0 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Splitting the commandline. Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'. Reading option '-i' ... matched as input file with argument 'test.avs'. Finished splitting the commandline. Parsing a group of options: global . Applying option v (set logging level) with argument 9. Successfully parsed a group of options. Parsing a group of options: input file test.avs. Successfully parsed a group of options. Opening an input file: test.avs. [avisynth @ 056936a0] Format avisynth probed with size=2048 and score=50 [avisynth @ 056936a0] Before avformat_find_stream_info() pos: 0 bytes read:55 seeks:0 [avisynth @ 056936a0] All info found [avisynth @ 056936a0] 0: start_time: 0.000 duration: 0.001 [avisynth @ 056936a0] 1: start_time: 0.000 duration: 2.658 [avisynth @ 056936a0] stream: start_time: 0.000 duration: 60.279 bitrate=0 kb/s [avisynth @ 056936a0] After avformat_find_stream_info() pos: 0 bytes read:55 seeks:0 frames:3 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, avisynth, from 'test.avs': Duration: 00:01:00.28, start: 0.000000, bitrate: 0 kb/s Stream #0:0, 2, 1001/24000: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 1920x816, 1001/24000, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc Stream #0:1, 1, 1/44100: Audio: pcm_f32le, 44100 Hz, 2 channels, flt, 2822 kb/s Successfully opened the file. At least one output file must be specified [AVIOContext @ 0496dc40] Statistics: 55 bytes read, 0 seeks > (note: that build has some extra patches in it, so it's actually maybe one or two commits behind yours, rather than five ahead) Last edited by qyot27; 14th November 2015 at 07:32. |
14th November 2015, 19:27 | #6 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,560
|
Thanks Motenai Yoda for the command, it helped me get the Pipe version working.
I really prefer the progress output of x264.exe than of ffmpeg. Is there a way to get that output? Or any way to get "Estimated time left"? For a 1 hour job, I want to know how much longer it will take. |
15th November 2015, 06:23 | #7 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,560
|
How do you encode the audio?
Here's my command. It ignores the audio. cmd /c Encoder\avs2yuv.exe "F:\NaturalGrounding\Temp\Job6_Script.avs" -o - | Encoder\ffmpeg.exe -y -i - -c:a copy -c:v libx264 -preset veryslow -crf 24 "F:\NaturalGrounding\Temp\Job6_Output.mkv" -frames 600 I also tried with "-acodec pcm_s16le", which doesn't help any more. |
15th November 2015, 06:42 | #8 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,992
|
Quote:
You could take a look here, until someone can tell you exactly what you want. https://trac.ffmpeg.org/wiki/Encode/AAC
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
15th November 2015, 06:59 | #10 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,992
|
I guess that you need to encode audio separately then, and then mux.
See The nero docs for use.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
15th November 2015, 07:01 | #11 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,992
|
Here:-
Code:
************************************************************* * * * Nero AAC Encoder * * Copyright 2009 Nero AG * * All Rights Reserved Worldwide * * * * Package build date: Feb 18 2010 * * Package version: 1.5.4.0 * * * * See -help for a complete list of available parameters. * * * ************************************************************* Usage: neroaacenc [options] -if <input-file> -of <output-file> Where: <input-file> : Path to source file to encode. The file must be in Microsoft WAV format and contain PCM data. Specify - to encode from stdin. Note that multiple input files can be specified, they will be encoded together into a single output file with chapter marks indicating source file divisions. <output-file> : Path to output file to encode to, in MP4 format. ==== Available options: ==== Quality/bitrate control: -q <number> : Enables "target quality" mode. <number> is a floating-point number in 0...1 range. -br <number> : Specifies "target bitrate" mode. <number> is target bitrate in bits per second. -cbr <number> : Specifies "target bitrate (streaming)" mode. <number> is target bitrate in bits per second. When neither of above quality/bitrate options is used, the encoder defaults to equivalent of -q 0.5 Multipass encoding: -2pass : Enables two-pass encoding mode. Note that two-pass more requires a physical file as input, rather than stdin. -2passperiod : Overrides two-pass encoding bitrate averaging period, <number> : in milliseconds. : Specify zero to use least restrictive value possible (default). Advanced features / troubleshooting: -lc : Forces use of LC AAC profile (HE features disabled). -he : Forces use of HE AAC profile (HEv2 features disabled). -hev2 : Forces use of HEv2 AAC profile Note that the above switches (-lc, -he, -hev2) should not be used; optimal AAC profile is automatically determined from quality/bitrate settings when no override is specified. -ignorelength : Ignores length signaled by WAV headers of input file. Useful for certain frontends using stdin. EDIT: Here similar to previously given Bat file to extract to WAV Code:
setlocal REM Where to Find ffmpeg set FFMPEG="C:\BIN\ffmpeg.exe" REM Where to get input file, No terminating Backslash, "." = current directory set INDIR="." REM Where to place output file, No terminating Backslash. set OUTDIR=".\OUTPUT" FOR %%A IN (*.wmv *.mpg *.avi *.flv *.mov *.mp4 *.m4v *.RAM *.RM) DO ( %FFMPEG% -i "%INDIR%\%%A" -vn -acodec pcm_s16le "%OUTDIR%\%%~nxA.WAV" ) Pause
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 15th November 2015 at 07:12. |
15th November 2015, 16:38 | #13 | Link |
Registered User
Join Date: Jan 2010
Posts: 709
|
for audio I think is an avs2yuv thing, what you can do?
add soundout into the avs to get audio into a wav file when encoding the video encode it with naac or fdkaac or qaac, both better than naac then mux the audio using another input argument for ffmpeg as ffmpeg -i video.h264 -i audio.m4a -map 0:v -map 1:a -c copy output.mp4 but using x86 bin even just encode the audio too as pcm and using ffmpeg pipe it to naac/fdkaac/qaac mux
__________________
powered by Google Translator |
15th November 2015, 17:07 | #14 | Link | |
/人 ◕ ‿‿ ◕ 人\
Join Date: May 2011
Location: Russia
Posts: 643
|
Quote:
As for neroaac and ffmpeg http://sound.stackexchange.com/a/23246 Last edited by vivan; 15th November 2015 at 17:18. |
|
15th November 2015, 17:48 | #15 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,434
|
Quote:
There are modified old x264 versions that can process audio (look for taro's tmod builds), but none recently, only old ones |
|
15th November 2015, 20:50 | #18 | Link | ||||
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,445
|
Quote:
Quote:
Quote:
Quote:
Although if you're not married to the idea of requiring AAC in the final encode, you could always use Vorbis or Opus and output to an MKV file instead. |
||||
15th November 2015, 21:16 | #19 | Link | |||
Soul Architect
Join Date: Apr 2014
Posts: 2,560
|
Quote:
I was wondering why they couldn't just get the MT version working until I tried creating some threads in C++, at which point I realized that multi-threaded programming in C++, especially when you don't want to create locks, is a huge mess that even experts get lost with. Because the C++ compiler has no awareness of threads, when it compiles multi-threaded code, the order of operations is random, what you see happening is random, memory data gets corrupted and the behavior is "undefined". Working your way to fix bugs from there is extremely hard. Some C++ experts even say that there is no such thing as bug-free multi-threaded C++ programs. Let's hope someone will make AviSynth+ MT work some day; without crashing on NNEDI3 plugin. Quote:
Quote:
If I want to have a standard MP4 file, however, then that's where re-encoding becomes useful. |
|||
15th November 2015, 21:21 | #20 | Link | |
Soul Architect
Join Date: Apr 2014
Posts: 2,560
|
Quote:
Edit: ah great... it doesn't support MT Edit2: Is this the right way to do it? Removing MT code and appending to the end of the script file Code:
TWriteWAV("F:\NaturalGrounding\Temp\Job1_Output.wav", true) ForceProcessWAV() Code:
avs2yuv.exe "Job1_Script.avs" -o - Edit3: Got it working. All that's left is to encode WAV into AAC before muxing.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 15th November 2015 at 23:07. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|