Log in

View Full Version : Avidemux and vertical subtitles


il biggo
22nd July 2011, 23:06
I'm trying to convert a bunch of MKV files to AVI, for viewing on a home theatre system. Avidemux does everything beautifully after a few experiments with pixel ratio, resolution etc.
The MKV files contain A S S subtitles, which Avidemux's Subtitles filter renders with a few differences from the whatever-the-engine-is-that-does-it-in-mplayer. The fonts are a bit thinner, the italics are a bit more slanted, no big deal.
The real problem lies in vertical text: in every mplayer-based player, I can rotate a line of text (\frz-90) and keep the single characters' standard orientation (with the "@fontname" method). The same method doesn't work in Avidemux, i.e. the line AND the fonts are rotated, as you can see in the two captures. I'm not sure if this is a bug in Avidemux, in the Subtitles filter, or if I'm doing something wrong. Any clue?
:thanks:

LoRd_MuldeR
23rd July 2011, 15:19
If Avidemux' "built-in" subtitle filter cannot do the effect you want, maybe you can use Avisynth input and add the subtitles on the Avisyth side, e.g with VSFilter?

il biggo
23rd July 2011, 23:13
I've never used Avisynth but I guess I'll give it a try.
VSFilter definitely will do it right, since single characters rotation should be standard behaviour for A S S subtitles.
Thank you very much, Lord Mulder. I'll post the results for reference. :thanks:

il biggo
28th July 2011, 23:16
Wow. Thanks a lot, Mulder! \o/ The TextSub filter follows A S S standards perfectly.
The result is identical to what I see from the MKV in Mplayer.
(The subtitles are some 10ms late, but I can modify all subs files in Aegisub)
I just hope I can batch-convert a bunch of files [goes back to reading]

il biggo
3rd August 2011, 20:40
Sorry to bother you (and I don't think this belongs in this thread but I'm not sure where to post it),
but avidemux has stopped responding to the proxy and I'm completely lost. I searched the forums, and the internet for that matter `-´, to no avail.
Be it by means of the "dummy file" (ADAP etc.), via avsproxy_gui, or by using "Connect to avsproxy" from the menu, all I get is a gray screen.
The AviSynth filters are working, i.e. I see subtitles and a black border I added, but it seems like DirectShowSource isn't passing the video data.
It worked a couple days ago (i even burned a few tests on DVD) and I can't understand what's up.

As for the batch conversion, this is my batch file (I'm quite proud of it ^_^) - it loops through all videos in the directory, creates the avs script,
feeds it to the proxy in a separate thread and starts avidemux. "connect2proxy.avi" is the "dummy file".
:helpful:

@echo off
for %%f in (*.mp4) do (

if exist "%%~nf.avs" del "%%~nf.avs"
echo ffmpegsource("%%~pf%%f"^) >"%%~nf.avs" '<--- EDIT (see next message) :confused:
echo ConvertAudioTo16bit(^) >>"%%~nf.avs"
echo ConvertToYV12(^) >>"%%~nf.avs"
echo TextSub("%%~pf%%~nf.ass"^) >>"%%~nf.avs"
echo AddBorders(0,0,0,12^) >>"%%~nf.avs"

start "proxy" /D "%%~pf" "C:\Program Files (x86)\Avidemux 2.5\avsproxy.exe" "%%~nf.avs"

echo waiting for proxy...
choice /C x /T 10 /D x
"C:\Program Files (x86)\Avidemux 2.5\avidemux2.exe" --force-alt-h264 --audio-codec AC3 --audio-bitrate 224 --video-codec xvid --codec-conf b2divx --load "connect2proxy.avi" --save "AVI\%%~nf [subITA].avi" --quit

del "%%~nf.avs"
Move "%%f" done\
)

il biggo
3rd August 2011, 22:12
And obviously, just when I lost all hopes and pestered a knowledgeable fellow (that would be you) about this, I found a "solution".
Ffmpegsource seems to work. I don't know what has happened to DSS, but I'll file this under "windows quirks".

il biggo
4th August 2011, 17:31
Talking to myself here, sorry 'bout that, let's call it a diary :)
DirectShowSource was conflicting with the infamous Nero MP4 splitter, wherever did that come O_o. It delivers the video now. No audio. Rats.

I'm using Ffmpegsource2() now, thus reading from the original MKV file instead of the converted .mp4 files (which I had done through HandBrake to have a constant frame rate).
This allowed me to move the YV12 conversion in the first statement of the script together with the framerate adjustment, and to get rid of the ConvertAudio statement.
_________________________________________________________________________________

@echo off
for %%f in (*.mkv) do (

if exist "%%~nf.avs" del "%%~nf.avs"
echo FFmpegSource2("%%~pf%%f",vtrack=-1, atrack=-1, fpsnum=23976, fpsden=1000, width=704, height=480, resizer="LANCZOS", colorspace="YV12"^) >"%%~nf.avs"
echo TextSub("%%~pf%%~nf.ass"^) >>"%%~nf.avs"
echo AddBorders(0,0,0,12^) >>"%%~nf.avs"

start "proxy" /D "%%~pf" "C:\Program Files\Avidemux 2.5\avsproxy.exe" "%%~nf.avs"

echo waiting for proxy...
REM pause to allow ffmpegsource to create the mpeg index
choice /C x /T 30 /D x
"C:\Program Files\Avidemux 2.5\avidemux2.exe" --force-alt-h264 --audio-codec AC3 --audio-bitrate 224 --video-codec xvid --video-conf cq=3 --codec-conf=b2divx.xml --load "connect2proxy.avi" --save "AVI\%%~nf [subITA].avi" --quit

del "%%~nf.avs"
del "%%f.ffindex"
Move "%%f" done\
)
_________________________________________________________________________________

Next challenge: make the "--codec-conf" command work.
I tried putting the configuration file in the video directory - nothing.
I tried stating the full path (Appdata\Local\ etc.) to the original configuration file - nothing.
I searched everywhere for a "tutorial" on how to use "--codec-conf" - nothing. Does this command even exist?
The alternative method would be to put the configuration in an Avidemux script to be "--run" in the CLI. This would be a nightmare: I'm doing a batch conversion, so I would have to generate a different script for each file. Been there, done that, lost my sanity. :eek: