AnimeSuki Forums

Register Forum Rules FAQ Community Today's Posts Search

Go Back   AnimeSuki Forum > Anime Related Topics > General Anime > Fansub Groups

Notices

Reply
 
Thread Tools
Old 2009-11-01, 21:30   Link #1
lachs0r
not fansubbing 24/7
 
 
Join Date: Nov 2009
Location: Germany
Lightbulb Encoding on Linux - a few hints

I've been doing this for quite a while now and I thought I should share my knowledge with everyone here.

When trying to encode fansubs on Linux, there are a few issues:
  • No (working) native AviSynth
  • VirtualDub/DirectShow doesn't work too well with wine
  • No native subtitling filter that works like VSFilter (and can emulate it's bugs correctly)

However, there's a tool to solve these problems:
Avidemux (and avsproxy.exe, which comes with Windows builds of Avidemux).

Instructions:
  1. Start Avidemux (the native version, of course)
  2. Execute wine avsproxy.exe yourscript.avs in a terminal
  3. When avsproxy is ready (there should be no errors and a message "Waiting for client to connect... "), in Avidemux, select Avidemux->Connect to avsproxy
  4. Now you can encode using your preferred settings

There are some things to consider when writing your scripts:
  • DirectShowSource didn't always work the last time I've checked (about 8 months ago), so you should use FFmpegSource2 instead (which seems to do a better job with converting VFR sources to CFR anyway)
  • There's no sound output, you have to use a prepared external .wav for Avidemux
  • Only YV12 color space is supported for video output (but that shouldn't be a problem, because MPEG4-ASP and MPEG4-AVC use this color space anyway)

The good news is that everything else seems to work fine without modifications, including VSFilter.

I hope that helps a few people here, feel free to start the usual Linux vs. Windows trollfest.
lachs0r is offline   Reply With Quote
Old 2009-11-02, 19:46   Link #2
zhurai-tsuki
...
*Fansubber
 
Join Date: Oct 2007
Location: California
hmm nice, thanks :O
zhurai-tsuki is offline   Reply With Quote
Old 2009-11-02, 20:03   Link #3
martino
makes no files now
 
 
Join Date: May 2006
OK, I didn't encode for nearly a year now... but I managed to avoid the whole AviDemux stage and just got around with VDub, AviSynth, avs2yuv and BePipe perfectly under wine (DGIndex and YATTA worked too for those that care), the remaining apps were all native (x264, oggenc, ffmpeg, you name it). Also DSS worked just fine, 98% of the time anyway, as did sound output. All that was needed was a native quartz.dll to be registered and for the codecs to be installed, IIRC. Mind you, it's been a long time since I did this the last time...
__________________
"Light and shadow don't battle each other, because they're two sides of the same coin"
martino is offline   Reply With Quote
Old 2009-11-02, 20:07   Link #4
zhurai-tsuki
...
*Fansubber
 
Join Date: Oct 2007
Location: California
Quote:
Originally Posted by martino View Post
OK, I didn't encode for nearly a year now... but I managed to avoid the whole AviDemux stage and just got around with VDub, AviSynth, avs2yuv and BePipe perfectly under wine (DGIndex and YATTA worked too for those that care), the remaining apps were all native (x264, oggenc, ffmpeg, you name it). Also DSS worked just fine, 98% of the time anyway, as did sound output. All that was needed was a native quartz.dll to be registered, IIRC. Mind you, it's been a long time since I did this the last time...
what version of wine was it back then o.o
zhurai-tsuki is offline   Reply With Quote
Old 2009-11-02, 20:11   Link #5
martino
makes no files now
 
 
Join Date: May 2006
1.1.8/9 or something was the latest I remember using for encoding. Never run AviSynth after that, so no clue how well (or how badly) it works now compared to back then ^^.
__________________
"Light and shadow don't battle each other, because they're two sides of the same coin"
martino is offline   Reply With Quote
Old 2009-11-05, 03:17   Link #6
Emess
Slower Than You
 
 
Join Date: Oct 2006
Location: Western Australia
Send a message via AIM to Emess Send a message via MSN to Emess Send a message via Yahoo to Emess
Quote:
Originally Posted by lachs0r View Post
I've been doing this for quite a while now and I thought I should share my knowledge with everyone here.
Most people here have been doing it longer than you.

Quote:
Originally Posted by lachs0r View Post
No (working) native AviSynth
There is, it's just not public, because nobody wants to share and encourage server-side encoding. Personally I agree with that outlook.

Quote:
Originally Posted by lachs0r View Post
VirtualDub/DirectShow doesn't work too well with wine
Works fine for me in both linux and freebsd, and I use a distro that's known for it's wine issues.

Quote:
Originally Posted by lachs0r View Post
No native subtitling filter that works like VSFilter (and can emulate it's bugs correctly)
http://forums.animesuki.com/showthread.php?t=85227 Faster than VSFilter too, a lot of people are asking for a dshow filter for libass it's that good.

Quote:
Originally Posted by lachs0r View Post
Avidemux (and avsproxy.exe, which comes with Windows builds of Avidemux).
Don't ever use avidemux, it's terrible.

Quote:
Originally Posted by lachs0r View Post
DirectShowSource didn't always work the last time I've checked (about 8 months ago), so you should use FFmpegSource2 instead (which seems to do a better job with converting VFR sources to CFR anyway)
Not only are you doing it wrong, you don't seem to know anything about DSS. DSS automatically assumes and converts to CFR, it is not capable of VFR. ffms2 on the other hand can do whatever. AVS itself is not VFR aware however so it's not a big deal. Neither source plugin converts to CFR, it assumes CFR and creates VFRaC.

Quote:
Originally Posted by lachs0r View Post
There's no sound output
Google for avs2wav. You shouldn't be using avs for much audio stuff anyway, trims should all be done with split_aud.pl, which runs natively in *nix anyway.

Quote:
Originally Posted by lachs0r View Post
Only YV12 color space is supported for video output (but that shouldn't be a problem, because MPEG4-ASP and MPEG4-AVC use this color space anyway)
Not even remotely true. I've output RGB perfectly well, as well as I422. x264 and whatnot all require YV12 input anyway so again, not a problem so much as an ignorant user.

Quote:
Originally Posted by lachs0r View Post
The good news is that everything else seems to work fine without modifications, including VSFilter.
VSFilter has a bug in the way it handles spacing, you might not have noticed it is all. It's wine's fault with VSFilter and no matter your VSFilter interface the bug is still there.

Quote:
Originally Posted by lachs0r View Post
I hope that helps a few people here, feel free to start the usual Linux vs. Windows trollfest.
Linux is dumb anyway, go use fbsd now.

E~
Emess is offline   Reply With Quote
Old 2009-11-05, 06:09   Link #7
lachs0r
not fansubbing 24/7
 
 
Join Date: Nov 2009
Location: Germany
Of course many people here have been encoding/fansubbing longer than me. That however is no reason for this arrogant attitude towards me.

AssRender didn't work for me with different recent wine releases (crashes as soon as subtitles have to be displayed, didn't have time to debug yet), maybe I've just been doing something wrong. Edit: Fixed it, somehow it only detected fonts in my wine prefix, and even Arial was missing there.
Also, try loading some of the bigger scripts like karaoke effects without splitting them into pieces.

Quote:
Don't ever use avidemux, it's terrible.
What makes it terrible and why shouldn't I use it? Did I miss something?

Quote:
Neither source plugin converts to CFR, it assumes CFR and creates VFRaC
Not entirely true. Just assuming VFR as CFR (VFRaC, which is the default for both plugins) would lose audio sync in most cases. Duplicating and removing frames for CFR conversion still has to be handled by the source plugin. Also, why should FFMS2 clearly name it "VFR -> CFR conversion" in it's documentation if it isn't even true?
I think I should explain what I was referring to with FFMS2 "doing a better job" at it.
As an example, take a source where one part is 60 FPS, the rest is 24000/1001 FPS.
Now converting FPS to 24000/1001 with DSS sometimes creates laggy movement (it just assumes 60 FPS as 24000/1001 and skips every ~25 frames), which I didn't experience with FFMS2.
But probably I've just been doing it wrong, as you say.

Quote:
There's no sound output
Quote:
Only YV12 color space is supported for video output
These are limitations of avsproxy, nothing more.

I didn't experience the spacing bug. No matter what script I throw at VSFilter in wine, the results are the exact same as on Windows. There's only one exception: It doesn't automatically embolden fonts that don't have a bold face available. Maybe there's an option in fonts.conf but meh, it's a bad practice anyway. AssRender should "fix" this. An alternative would be using FontForge, which should create better looking results, but takes five minutes of your precious time.

Quote:
Linux is dumb anyway, go use fbsd now.
Guess what's running on my router :P
I don't really like it's licensing though, but that's just me being a GPL/LGPL nazi. Whatever.

Thanks for the reply however.

Last edited by lachs0r; 2009-11-05 at 06:25.
lachs0r is offline   Reply With Quote
Old 2009-11-05, 09:02   Link #8
Emess
Slower Than You
 
 
Join Date: Oct 2006
Location: Western Australia
Send a message via AIM to Emess Send a message via MSN to Emess Send a message via Yahoo to Emess
Quote:
Originally Posted by lachs0r View Post
What makes it terrible and why shouldn't I use it? Did I miss something?
It just does lots of stupid things and doesn't read a lot of sources properly.

Quote:
Originally Posted by lachs0r View Post
Not entirely true. Just assuming VFR as CFR (VFRaC, which is the default for both plugins) would lose audio sync in most cases. Duplicating and removing frames for CFR conversion still has to be handled by the source plugin. Also, why should FFMS2 clearly name it "VFR -> CFR conversion" in it's documentation if it isn't even true?
I think I should explain what I was referring to with FFMS2 "doing a better job" at it.
As an example, take a source where one part is 60 FPS, the rest is 24000/1001 FPS.
Now converting FPS to 24000/1001 with DSS sometimes creates laggy movement (it just assumes 60 FPS as 24000/1001 and skips every ~25 frames), which I didn't experience with FFMS2.
But probably I've just been doing it wrong, as you say.
I am too lazy to explain in proper and I worded it poorly previously. DSS assumes a framerate unless you tell it something specific, DSS2 converts to one. They both do it somewhat arbitrarily but are not too bad. Try running them on anything with null frames though, it's a mess. ffms2 is the only source plugin that should be used on pretty much everything besides transport and program streams. It handles VFR correctly.

Quote:
Originally Posted by lachs0r View Post
These are limitations of avsproxy, nothing more.
Should be using avs2yuv for video and avs2wav for audio. It's the closest you'll get to native avisynth support without Knowing People.

Quote:
Originally Posted by lachs0r View Post
I didn't experience the spacing bug. No matter what script I throw at VSFilter in wine, the results are the exact same as on Windows. There's only one exception: It doesn't automatically embolden fonts that don't have a bold face available. Maybe there's an option in fonts.conf but meh, it's a bad practice anyway. AssRender should "fix" this. An alternative would be using FontForge, which should create better looking results, but takes five minutes of your precious time.
Odd, you are the first person I don't know to have experienced it. Maybe your spacing is non-0 so it didn't effect you, it's only an issue on 0 spacings. As for the bold thing, that's probably a freetype issue more than anything, get into #aegisub on IRC and ask greg about it.

Quote:
Originally Posted by lachs0r View Post
Guess what's running on my router :P
I don't really like it's licensing though, but that's just me being a GPL/LGPL nazi. Whatever.

Thanks for the reply however.
People prefer GPL to BSDL, whaaaaaaaaat? D:

You're welcome.

E~
Emess is offline   Reply With Quote
Old 2009-11-05, 18:32   Link #9
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 37
being someone who has encoded far longer than emess and is far better than him at being an elitist asshole, I cordially ask him to please shut up

twc is a terrible unfunny troll that should get out, but he's actually right on one point, namely that if you don't care about vfr and have a decent decoder/splitter for the format you want to open (ok well that's a lot of ifs), dss2 is actually far less buggy than ffms2, plus faster (no indexing) and easier to use
chew on that one for a while

my libass avs filter is really more of a proof of concept thing than a real filter. I do not recommend using it for actual releases. it's also linked against a libass that is kinda outdated now.

Quote:
Originally Posted by Emess View Post
As for the bold thing, that's probably a freetype issue more than anything, get into #aegisub on IRC and ask greg about it.
more like it's a windows-specific (mis?)feature


also: people who use the gpl for non-trolling purposes are usually worse than the riaa/mpaa when it comes to making threats about suing people
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read
TheFluff is offline   Reply With Quote
Old 2009-11-06, 17:14   Link #10
Starks
I see what you did there!
*Scanlator
 
 
Join Date: Apr 2004
Age: 36
Send a message via AIM to Starks
emess, are you telling me that someone actually bothered to make avisynth cross-platform? is avs3 making a comeback?
__________________
Starks is offline   Reply With Quote
Old 2009-11-07, 16:34   Link #11
Emess
Slower Than You
 
 
Join Date: Oct 2006
Location: Western Australia
Send a message via AIM to Emess Send a message via MSN to Emess Send a message via Yahoo to Emess
No, it is not cross platform, it is very specifically FreeBSD and Gentoo/Arch x86_64. It might work on other things but I have no idea. The code is split from 2.5.8 rather than a complete rewrite, and only certain filters work on it iirc. AVS3 is dead and gone. I am also aware of a new project that is similar to avs3 in parts but also completely different, that may or may not replace avisynth as a whole.

E~
Emess is offline   Reply With Quote
Old 2009-11-07, 20:00   Link #12
Starks
I see what you did there!
*Scanlator
 
 
Join Date: Apr 2004
Age: 36
Send a message via AIM to Starks
Why isn't that avisynth branch public (does it even have a name?) and what is the name of that new avisynth-like project?
__________________
Starks is offline   Reply With Quote
Old 2009-11-07, 22:51   Link #13
fireshark
CRF Believer
*Fansubber
 
 
Join Date: Jan 2007
Send a message via AIM to fireshark
Quote:
Originally Posted by Emess
There is, it's just not public, because nobody wants to share and encourage server-side encoding. Personally I agree with that outlook.
Reading is always a good idea.
fireshark is offline   Reply With Quote
Old 2009-11-09, 01:02   Link #14
Starks
I see what you did there!
*Scanlator
 
 
Join Date: Apr 2004
Age: 36
Send a message via AIM to Starks
Is server-side encoding the next big thing for fansubbing? Aside from off-loading a task that previously required a beefy computer, how does it work?
__________________
Starks is offline   Reply With Quote
Old 2009-11-09, 09:48   Link #15
lachs0r
not fansubbing 24/7
 
 
Join Date: Nov 2009
Location: Germany
It's fairly easy to use another host as frameserver, wether you modify avsproxy/Avidemux/whatever or use avs2yuv + mkfifo + NFS.

Also, the term server-side encoding doesn't have a real meaning at all. It doesn't even make sense in this context, since AviSynth is a frameserver and not really doing any encoding. The encoding is done by a client, such as VirtualDub or Avidemux.
Hence, load distribution would be a better term.
lachs0r is offline   Reply With Quote
Old 2009-11-09, 14:17   Link #16
TheFluff
Excessively jovial fellow
 
 
Join Date: Dec 2005
Location: ISDB-T
Age: 37
When he says server-side he means encoding on a remote box with a fast connection and better CPU than what you have at home. It's exactly like encoding at home except you do it over RDP or VNC, and it gets downloaded, encoded and uploaded faster. Another advantage is that other people can download and mux the encode even after the encoder has gone to bed.

It pretty much has no downsides other than the fact that doing things over RDP is annoying, so yes, it's a good idea if you can afford a server.
__________________
| ffmpegsource
17:43:13 <~deculture> Also, TheFluff, you are so fucking slowpoke.jpg that people think we dropped the DVD's.
17:43:16 <~deculture> nice job, fag!

01:04:41 < Plorkyeran> it was annoying to typeset so it should be annoying to read
TheFluff is offline   Reply With Quote
Old 2009-11-10, 04:21   Link #17
TrickyDream
Junior Member
 
Join Date: Apr 2009
I've been using avs2yuv for a while and it works pretty good =D
avs2yuv to mencoder(ffv1 lossless) or x264.
About thd audio, before I made my own script to split the audio stream I was using foobar to convert the audio to wav and then I used to open virtualdub and load an avs with audiodub + audiodelay + trim and "save to wav", and the native neroAac to convert wav to aac.
I couldn't make avs2wav work. But indeed split_aud.pl is the best choice if you don't have to reencode.
TrickyDream is offline   Reply With Quote
Old 2009-11-10, 05:56   Link #18
Emess
Slower Than You
 
 
Join Date: Oct 2006
Location: Western Australia
Send a message via AIM to Emess Send a message via MSN to Emess Send a message via Yahoo to Emess
Quote:
Originally Posted by Starks View Post
Why isn't that avisynth branch public (does it even have a name?) and what is the name of that new avisynth-like project?
Because GPL is stupid and it's a private branch, nobody working on it gives a shit about sharing.The other project is as of yet un-named.

Quote:
Originally Posted by TheFluff View Post
When he says server-side he means encoding on a remote box with a fast connection and better CPU than what you have at home. It's exactly like encoding at home except you do it over RDP or VNC, and it gets downloaded, encoded and uploaded faster. Another advantage is that other people can download and mux the encode even after the encoder has gone to bed.

It pretty much has no downsides other than the fact that doing things over RDP is annoying, so yes, it's a good idea if you can afford a server.
Except that most people I can think of that do it don't bother downloading it to check any whatnot, so half the time it comes out with a borked IVTC or otherwise looking like shit. Commie's Letter Bee for example, broken IVTC everywhere.

E~
Emess is offline   Reply With Quote
Old 2009-11-10, 05:59   Link #19
Dark Shikari
x264 Developer
 
 
Join Date: Feb 2008
Quote:
Originally Posted by Emess View Post
Except that most people I can think of that do it don't bother downloading it to check any whatnot, so half the time it comes out with a borked IVTC or otherwise looking like shit. Commie's Letter Bee for example, broken IVTC everywhere.
I'm pretty sure people do that regardless of where they do the encoding.
Dark Shikari is offline   Reply With Quote
Reply

Tags
encoding, libass, linux, vsfilter, wine


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 -5. The time now is 11:52.


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