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.


Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co

Thread Tools Search this Thread Display Modes
Old 27th January 2014, 16:57   #1  |  Link
Registered User
Join Date: Jan 2014
Location: Guelph, Ontario
Posts: 1
Ubuntu 12.04 server video editing from CLI

Working for someone who has a virtual linux server (12.04LTS) who wants to process large amounts of video... two, three or four files that need to be stacked (side by side, or 3-4 on the screen at once) to make a single video with one audio track.

Server has no video card (headless), only able to use limited GUI through VNC, looking for suggestions for CLI solution to automate changing these hundreds of files into desired format.

To clarify: Project goal is to take two, three or four files and put them together to display as a single file (with two, three or four windows on screen) with one audio track. Large amounts of files need to be converted, so CLI and scripting will have to be used, GUI solutions cannot be used.

Output format can be AVI or mp4

I'm looking for suggestions on software to use and guides if written, have been attempting to get AVXsynth to work, but it seems ancient and clumsy... any and all suggestions are appreciated. I am new to linux, so as much detail as can be given would be appreciated... suggestions such as 'simply rebuild using current .git repositories' don't mean much to me... I literally need step by step guides to install, configure and use whatever software people use to do this...

I was able to get an AVIsynth install running on Windows 7 that could do this, now I basically need to do the same on Linux Ubuntu 12.04LTS

No changes can be made in the operating system, 12.04 server LTS MUST be used, and is a virtual server... Running WINE is not desirable unless performance while running on a virtual server isn't impacted...

Thanks in advance for any help.
Linuxnoob is offline   Reply With Quote
Old 30th January 2014, 10:57   #2  |  Link
qyot27's Avatar
Join Date: Nov 2005
Location: Florida
Posts: 1,420
As mentioned in the Doom10 post, I'm copying the content over here too.

Originally Posted by Linuxnoob
I can't even find guides or anything for Ubuntu/linux with avxsynth.
The reason you can't find guides specifically for AvxSynth is because it's not needed - guides for AviSynth work just as long as you keep yourself restricted to what works for AviSynth 2.5.8's core stuff.

The problem with using the System-Setup page from the AvxSynth wiki is that it's ridiculously outdated. The recommended versions of FFmpeg and FFMS2 are higher now. There's no need to use avxFrameServer at all anymore - x264 has supported direct input of scripts by using AvxSynth on Linux & OSX since last February, so if you built x264 from git rather than grabbing it from the repositories, then you can just use the script as-is. FFmpeg committed the rewritten demuxer in March of last year, Libav finally got around to committing it in December, making it possible to use either FFmpeg 2.0 (or higher, although preferably FFmpeg-git) or Libav-git to open scripts on Linux and OSX by using AvxSynth - or as an extension of the support in libavformat, to watch scripts using any player that uses libavformat, like mpv. Also, there are issues with AVXEdit crashing, so it's better to use --disable-avxedit when configuring AvxSynth, meaning that the Qt requirements aren't actually required (and wouldn't be any use on a headless server anyway). In a visual environment, it's not like AVXEdit could even do syntax highlighting from what I remember, so you'd be better off with [generic text editor: Leafpad, gedit, Kate, etc.]+mpv anyway.

AvxSynth also for some reason doesn't like FFMS2.avsi (or .avsi files in general, more likely) - this means you can't use the FFmpegSource2 wrapping function, so if you need video+audio, you have to use FFVideoSource and FFAudioSource separately, and then AudioDub to join them for output:
As a critique of that sample script, FFVideoSource doesn't pass audio at all, so that audio=true and audio=false either do nothing or would error out. Besides that, it wouldn't be 'audio', it'd be 'atrack' with a number value (and in FFAudioSource where 'atrack' would be used, it takes number values, not true/false).

I did almost post this on Doom9 instead (I may copy this post over there for coverage's sake), but you can see updated instructions here:

The only thing to really remember is that bash has different character escaping rules than cmd.exe, so things like (, ), and " all need to be escaped with a \ when being echo'ed into an AviSynth script as part of an automated bash script. Where on Windows, you could do:
echo FFVideoSource("file.mkv")>test.avs
Under bash, you have to do:
echo FFVideoSource\(\"file.mkv\"\)>test.avs
In terms of what options to pass to x264 or FFmpeg, what works for x264 and FFmpeg builds on Windows will work on Linux; the way directories are referred to are the biggest difference (or the ability to for-loop the conversion like JEEB noted so you don't have to echo scripts individually - you can even experiment with this on Windows by using msysgit's, msys', or cygwin's version of bash).

For example, and purely for example (choose other configuration options; these are meant for speed only):
ffmpeg -i test.avs -vcodec libx264 -preset ultrafast -crf 18 -acodec libmp3lame -ab 192k test.mp4
Encoding H.264 and MP3 through FFmpeg requires --enable-libx264 and --enable-libmp3lame being used when you ./configure'd FFmpeg (as well as x264's and LAME's development libraries having been installed already so that FFmpeg knows they're there).
qyot27 is offline   Reply With Quote
Old 1st February 2014, 23:45   #3  |  Link
Registered User
Selur's Avatar
Join Date: Oct 2001
Location: Germany
Posts: 7,277
may be instead of using avisynthWhatever one could probably stick to ffmpeg using the pad, movie and overlay filter, http://stackoverflow.com/questions/1...several-videos seems like a simple example which shows the general idea. (encoding setting would still be needed)
more complex example: http://stackoverflow.com/questions/1...vies-in-ffmpeg
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote

12.04lts, batch, headless, server, stacking

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 01:36.

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