View Full Version : AviSynth rendered subtitles to BluRay SUP/PGS and BDN XML (v2.08)
OptimusX
10th September 2012, 23:41
The SUP output is awesome. Good work. You may not know it, but this program is becoming a standard in fansub applications for avchd and bd output.
djmasturbeat
17th January 2013, 01:21
easyavs2bdnxml
GUI supports last avs2bdnxml v2.05.
Original Chinese version's here http://bbs.siluhd.com/thread-385883-1-1.html
English/Russian version (with authored interface) is here http://www.adrive.com/public/n7BQPV/...nxml-0.3.4.zip
would you mind re-hosting this GUI?
the link for the Russian/English version does not work, maybe link is corrupted or file removed.
ps auxw
17th January 2013, 14:17
The SUP output is awesome. Good work.
Wow, I somehow missed that there are new posts in this thread. It's great to hear that it seems to be working well!
Too bad about the dead link for the GUI frontend.
djmasturbeat
20th January 2013, 20:21
okay, so I am trying this out but I am not the most adept at cli, so please advise what I am doing wrong.
I suspect it is something to do with
-t
I am not sure what we should be inputting for trackname.
I simplified dir path and filenames for myself as much as I can for easy cli call, but still get an error.
here is my cli and error
C:\Users\jonathan>C:\Users\jonathan>""C:\avs2bdnxml\avs2bdnxml.exe" avs2bdnxml -t PYCAL -l eng -v 1080i -f 30 -a1 -p1 -b1 -u0 -m3 -o "C:\avs2bdnxml\PYCAL\PYCAL.xml" "C:\avs2bdnxml\PYCAL.avs"
The filename, directory name, or volume label syntax is incorrect.
i also tried removing the -t but no love
C:\Users\jonathan>C:\Users\jonathan>""C:\avs2bdnxml\avs2bdnxml.exe" avs2bdnxml -l eng -v 1080i -f 30 -a1 -p1 -b1 -u0 -m3 -o "C:\avs2bdnxml\PYCAL\PYCAL.xml" "C:\avs2bdnxml\PYCAL.avs"
The filename, directory name, or volume label syntax is incorrect.
here is my avs for the ass, btw:
LoadPlugin("C:\MeGUI\tools\dgavcindex\DGAVCDecode.dll")
AVCSource("C:\LUPIN_RETURN_OF_PYCAL_CUSTOM\LUPIN_RETURN_OF_PYCAL\00002_1_01.dga")
LoadPlugin("C:\MeGUI\tools\avisynth_plugin\vsfilter.dll")
MaskSub("C:\avs2bdnxml\PYCAL_BD_SUBS.ass",1920,1080,29.970,85575)
#FlipVertical()
all the folders and paths do exist, as do the files I call (*.ass, *.avs)
thanks for any help for a noob.
ps auxw
20th January 2013, 21:11
C:\Users\jonathan>C:\Users\jonathan>""C:\avs2bdnxml\avs2bdnxml.exe" avs2bdnxml -t PYCAL -l eng -v 1080i -f 30 -a1 -p1 -b1 -u0 -m3 -o "C:\avs2bdnxml\PYCAL\PYCAL.xml" "C:\avs2bdnxml\PYCAL.avs"
The filename, directory name, or volume label syntax is incorrect.
i also tried removing the -t but no love
C:\Users\jonathan>C:\Users\jonathan>""C:\avs2bdnxml\avs2bdnxml.exe" avs2bdnxml -l eng -v 1080i -f 30 -a1 -p1 -b1 -u0 -m3 -o "C:\avs2bdnxml\PYCAL\PYCAL.xml" "C:\avs2bdnxml\PYCAL.avs"
The filename, directory name, or volume label syntax is incorrect.
Okay, I see multiple problems, and only one of them is an actual avs2bdnxml usage problem. "-f 30" is not supported, hopefully "-f 29.97" will work for you? You specified 29.970 in your AVS after all. If you really need 30fps, since calculation is done with non-drop frame timecodes, you could try replacing the frame rate in the resulting XML file, if it is actually supported, but I don't think this should be necessary.
As for the track name, it's just a string that is written to the XML file, like "Colored English subtitles" or whatever.
For the rest, you apparently have the prompt "C:\Users\jonathan>" copied into your command line. You also have an extra quote (") at afterwards. Additionally, there shouldn't be an "avs2bdnxml" after you already specified the path to the executable. Try the following:
"C:\avs2bdnxml\avs2bdnxml.exe" -t PYCAL -l eng -v 1080i -f 29.97 -a1 -p1 -b1 -u0 -m3 -o "C:\avs2bdnxml\PYCAL\PYCAL.xml" "C:\avs2bdnxml\PYCAL.avs"
If you do not feel comfortable with the command line, you can also copy this into a batch file (e.g. "runavs2bdnxml.bat") and double click that.
For your AVS, since you are directly specifying the frame size, number of frames etc. in the MaskSub call, you can throw out the parts about loading the video, since MaskSub doesn't use it anyway:
LoadPlugin("C:\MeGUI\tools\avisynth_plugin\vsfilter.dll")
MaskSub("C:\avs2bdnxml\PYCAL_BD_SUBS.ass",1920,1080,29.970,85575)
djmasturbeat
20th January 2013, 21:34
thanks for the fast reply
I had entered 30 fps b/c in the first page it was mentioned it worked better to use that then to edit the xml output and put 29.97 back in.
http://forum.doom9.org/showthread.php?p=1313944#post1313944
that said, when I use 30 I get an error
Is all this no longer needed for input to Scenarist? Or if it is needed, do I need to change it somewhere else (like the avs script) to work? Then I would edit the XML back to 29.97 for scenarist?
Other than that, thanks for the suggested cli call, it works with 29.97, I just need to be sure this won't botch input in scenarist, or go out of sync.
thanks again.
C:\Users\jonathan>"C:\avs2bdnxml\avs2bdnxml.exe" -t PYCAL -l eng -v 1080i -f 30 -a1 -p1 -b1 -u0 -m3 -o "C:\avs2bdnxml\PYCAL\PYCAL.xml" "C:\avs2bdnxml\PYCAL.avs"
Error: Invalid framerate (30).
ps auxw
20th January 2013, 21:40
In the beginning there were some bugs in the timecode calculation code, but they have long been fixed. Using 29.97 should be perfectly fine now.
djmasturbeat
20th January 2013, 21:45
ok
awesome
thanks so much for this great software =)
it really is getting to be known as quite the tool for enthusiasts to render subs for subbed blu-rays.
ps auxw
20th January 2013, 21:49
You're welcome. I'm glad it's useful. :)
djmasturbeat
20th January 2013, 22:17
if scenarist parser rejected this xml, is this possibly because of my *.ass subtitle script, more than likely?
If it is in my script, is there a way I need to tell avs2bdnxml where to split an epoch for a screen with text in several places, or should this be automatic?
If this isn't my issue, I will have to look in other places in the *.ass.
also...okay, sorry for the ignorance here, am I supposed to have actual png files too?
b/c I only have an xml output in the output folder.
thanks again.
ps auxw
20th January 2013, 23:10
also...okay, sorry for the ignorance here, am I supposed to have actual png files too?
b/c I only have an xml output in the output folder.
thanks again.
It won't work without the PNG files. Without them, Scenarist can't import, because there's nothing there. Check if they ended up in another folder, like the place you ran avs2bdnxml from or the avs2bdnxml folder. I should probably make it place the files in the same place as the XML file so this kind of thing doesn't happen...
djmasturbeat
20th January 2013, 23:15
ok, i found them.
since i ran cli from my username account (rather than cd first to C: or rather than using elevated command) it ended up in that main user directory terminal c:\users\myusername\*.png
yeah, probably a good idea to force default to same dir as the xml and then add ability to change it if desired.
thanks again.
djmasturbeat
3rd February 2013, 15:14
avs2bdnxml works great. However I have been experiencing a strange issue with avs2bdnxml (2.05), which creates a flicker. It has happened really since my first project.
I am curious if anyone else has observed such a thing, or if anyone has suggestions what might be causing this on my end... or if this may be a bug, or what?
I will try to make this as clear as I can.
If need-be, ps auxw, I can send you copies of the files: ass, avs, cli, xml+png for a few projects.
Any with an inline effect-hacked xml, will also contain the original output from avs2bdnxml (both have the same issue, detailed as follows).
I will render my .ass files with the newest build of avs2bdnxml, and there is almost always one line that mysteriously is doubled/duplicated.
It manifests itself in 2 forms:
1) 2 instances will appear in the same Epoch, with 2 Display Sets within that Epoch
2) It will show up as 2 consecutive Epochs
In either case, the repeated instance of this single line will always have a small gap in the times between these 2 occurrences.
I *can* fix it in ScenaristBD inside the PES editor (by removing the second instance, whether a new Epoch or new Display Set, and extending the ending time for the first instance to match the ending time of the second instance I remove).
*But* in order to fix it, I have to first fully mux the Blu-ray (time and PC-intensive), then watch the full movie first, really scrutinizing every line. This is sort of a big deal. This could become a compounded bigger issue when I will be adding multiple subtitles (which I have planned), all requiring watching the movie in those sub language, paying close attention to every line.
Usually the duplicated instance is happening near the start of a script, in the very first or second Epoch.
But not always.
The first time I noticed it, I thought at first it may have something to do with a preceding line (A Title) using a fade-in inline effect hacked into the xml. But whether I import in the original xml or the altered one, the result is the same. Then it happened on the very first subtitle in my most recent job, too.
for example the first lines are as such:
Dialogue: 0,0:01:24.64,0:01:26.73,Default,,0,0,0,,The year After Colony 195.
Dialogue: 0,0:01:27.68,0:01:30.87,Default,,0,0,0,,A group of Colony citizens\Nhostile toward the Alliance...
Dialogue: 0,0:01:30.95,0:01:34.64,Default,,0,0,0,,...sent young men to Earth\Non five Gundams.
after importing into scenarist and muxing and then watching I must track down multiple instances of lines inside the PES editor.
here is how this appears in Scenarist PES editor:
http://t.imgbox.com/adxDb3YV.jpg (http://imgbox.com/adxDb3YV) http://t.imgbox.com/abjFuB3n.jpg (http://imgbox.com/abjFuB3n)
here is another example from a different project, these screens I took a week, week and a half ago or so. These ones show in the same Epoch on 2 Display Sets, whereas the example above was 2 instances split across 2 Epochs:
http://t.imgbox.com/adle4gwQ.jpg (http://imgbox.com/adle4gwQ) http://t.imgbox.com/adlfjDMd.jpg (http://imgbox.com/adlfjDMd)
the xml file shows that this happens prior to importing to ScenaristBD:
<Event Forced="False" InTC="00:01:24:14" OutTC="00:01:24:15">
<Graphic Width="671" Height="59" X="625" Y="978">00002030_0.png</Graphic>
</Event>
<Event Forced="False" InTC="00:01:24:17" OutTC="00:01:26:16">
<Graphic Width="671" Height="59" X="625" Y="978">00002033_0.png</Graphic>
</Event>
the avs:
LoadPlugin("C:\MeGUI\tools\avisynth_plugin\vsfilter.dll")
MaskSub("C:\avs2bdnxml\Waltz_v3.ass",1920,1080,23.976,129984)
#FlipVertical()
my cli to run avs2bdnxml:
"C:\avs2bdnxml\avs2bdnxml.exe" -t Waltz -l eng -v 1080p -f 23.976 -a1 -p1 -b1 -u0 -m3 -o "C:\avs2bdnxml\Waltz_v3.xml" "C:\avs2bdnxml\Waltz_v3.avs"
thanks for any input, and thanks again for this great software.
ps auxw
3rd February 2013, 15:52
This sounds like a really strange problem. I see nothing in your command line, or the quoted ASS or AVS that should lead to such a small pause, especially since line splitting isn't even abled. Could you frame step through the output of your AVS and make sure that the problem isn't on that side (e.g. the subtitle somehow doesn't get rendered for a frame during that line)? Do you have a way of testing whether it happens with SUP output? Either way, please send me one set of ASS+AVS+XML+PNG files for a project where this occurred and I'll look into it.
djmasturbeat
3rd February 2013, 16:12
I have framestepped through the avs posted above, using avspmod, and noticed nothing like this on the .ass/.avs side.
In the Gundam example, the first sub line
Dialogue: 0,0:01:24.64,0:01:26.73,Default,,0,0,0,,The year After Colony 195.
in avspmod shows consistently from frame 2030 through 2079, with zero missing frames. No more subs till 2103, which is the next actual subtitle line proper:
Dialogue: 0,0:01:27.68,0:01:30.87,Default,,0,0,0,,A group of Colony citizens\Nhostile toward the Alliance...
Then all is okay after that.
I will send a pm to you after I post this, with links to the examples above.
The Lupin Pycal Ending scripts are really short, the Gundam Wing Endless Waltz is a full Movie, but only first line is affected. The main movie for Pycal was affected... but I forget which Epoch, so I left it out, but all 3 of the Pycal Endings were affected in the same way, which is where I first noticed this.
edit:
sup rendering... well, I would have to demux and remux the BD in other tools than Scenarist.
But this will cause other issues. I have had someone confirm to me that tsmuxer will not support time conflicts (overlapping subs and different subs changing at different times) as well as split epochs, even if contained in sups output from your software (this is the fault of the authoring tools, not your software). I use all these "time conflicts" and split epochs regularly, and Scenarist handles it fine, and so does avs2bdnxml.
But, for example these lines would not work in a sup imported to tsmuxer at all:
Dialogue: 0,0:51:08.26,0:51:12.94,Endless Waltz SE ED Lyrics Bold - Romanji,,0,0,0,,itoshisa wo inori ni kaete
Dialogue: 0,0:51:08.26,0:51:12.94,Endless Waltz SE ED Lyrics Bold - English,,0,0,0,,{\c&&H8BDAFF&&}I change this longing to prayers for you
Dialogue: 0,0:51:12.84,0:51:13.48,Default,,0,0,0,,It's here.
Dialogue: 0,0:51:13.07,0:51:17.84,Endless Waltz SE ED Lyrics Bold - Romanji,,0,0,0,,kono kodou wo tsutaetai yo
Dialogue: 0,0:51:13.07,0:51:17.84,Endless Waltz SE ED Lyrics Bold - English,,0,0,0,,{\c&&H8BDAFF&&}If only you could hear this heartbeat of mine
and of course Scenarist does not accept sup, it has its own proprietary version of sup, PES(+MUI).
I think the sup feature is nice for your software, but it appears that the shortcomings in some of the authoring tools will still require people to remove overlapping and time conflicting subs.
I can't even begin to guess how tsmuxer and others handle fade effects and alpha and turning subs on x/y axis with frz*** inside the ass. I can do all this in .ass and avs2bdnxml handles it perfectly, and scenarist is okay with it, to a degree (too much and I will get buffer underruns in audio and video, even if the 4 MB buffer -- auto update ticked -- shows nowhere near capacity in PES editor).
tl;dr, I don't think this would be an appropriate test for my subs, rendering to sup, since it would incur numerous other issues due to the authoring software needed to load a sup, rather than xml+png. It would not be a good litmus test, imo.
ps auxw
12th February 2013, 02:09
This is very strange. I have tested all three of your lupin samples and could not reproduce the duplicate line stutter issue. The only reason that I could imagine is some weird heisenbug in the inline assembly parts (or some other, annoying memory corrupting bug). Could you please test whether this build without inline assembly (http://ps-auxw.de/avs2bdnxml/avs2bdnxml-2.05-noasm.tar.bz2) works correctly for you? It is probably a bit slower though.
But, for example these lines would not work in a sup imported to tsmuxer at all:
Dialogue: 0,0:51:08.26,0:51:12.94,Endless Waltz SE ED Lyrics Bold - Romanji,,0,0,0,,itoshisa wo inori ni kaete
Dialogue: 0,0:51:08.26,0:51:12.94,Endless Waltz SE ED Lyrics Bold - English,,0,0,0,,{\c&&H8BDAFF&&}I change this longing to prayers for you
Dialogue: 0,0:51:12.84,0:51:13.48,Default,,0,0,0,,It's here.
Dialogue: 0,0:51:13.07,0:51:17.84,Endless Waltz SE ED Lyrics Bold - Romanji,,0,0,0,,kono kodou wo tsutaetai yo
Dialogue: 0,0:51:13.07,0:51:17.84,Endless Waltz SE ED Lyrics Bold - English,,0,0,0,,{\c&&H8BDAFF&&}If only you could hear this heartbeat of mine
In what way do these lines not work?
and of course Scenarist does not accept sup, it has its own proprietary version of sup, PES(+MUI).
I believe there was some way for Scenarist to import PGS files by going through some sort of converter that is included with it. I could be remembering wrong though.
djmasturbeat
12th February 2013, 06:24
This is very strange. I have tested all three of your lupin samples and could not reproduce the duplicate line stutter issue. The only reason that I could imagine is some weird heisenbug in the inline assembly parts (or some other, annoying memory corrupting bug). Could you please test whether this build without inline assembly (http://ps-auxw.de/avs2bdnxml/avs2bdnxml-2.05-noasm.tar.bz2) works correctly for you? It is probably a bit slower though.
a friend also tested the same things I sent you, and had none of the issues I did. He made sure to test with the latest build also.
weird.
I will try this other alt.build when I have time.
I have no idea what a heisenbug is tho, btw :whistle:
have to remember to google that later (going to bed now).
In what way do these lines not work?
from my understamding tsmuxer doesn't handle the overlapping subs and split epochs. I have not personally tested a sup or xml+png like this in tsmuxer, tbh. works great with scenarist and your tool, tho =)
I believe there was some way for Scenarist to import PGS files by going through some sort of converter that is included with it. I could be remembering wrong though.
there is a MUI generator, but I am pretty certain no .sup input as an ES. it takes the xml+png, renders them and creates its own proprietary sup-like file, PES, along with the MUI file. the PES(+MUI) can be imported later like a sup is in other tools.
if anyone knows a way for scenarist (BD or SD) to import a .sup, please tell me.
i will try to report back soon.
thanks for your sincere dedication.
paradoxical
12th February 2013, 15:21
I have no idea what a heisenbug is tho, btw :whistle:
It's just a pun on Heisenberg Uncertainty Principle.
ps auxw
12th February 2013, 17:54
a friend also tested the same things I sent you, and had none of the issues I did. He made sure to test with the latest build also.
weird.
I will try this other alt.build when I have time.
That really sounds strange. I did my tests using AviSynth 2.5.8 with VSFilter 1.0.1.5 (some 2008 Gabest build, apparently). If you use different versions and the new test build doesn't change anything, you could try matching the versions for these components.
from my understamding tsmuxer doesn't handle the overlapping subs and split epochs. I have not personally tested a sup or xml+png like this in tsmuxer, tbh. works great with scenarist and your tool, tho =)
There shouldn't really be any overlapping things in those subtitles when looking at it from after the avs2bdnxml processing step, as they just get merged.
there is a MUI generator, but I am pretty certain no .sup input as an ES. it takes the xml+png, renders them and creates its own proprietary sup-like file, PES, along with the MUI file. the PES(+MUI) can be imported later like a sup is in other tools.
if anyone knows a way for scenarist (BD or SD) to import a .sup, please tell me.
I think I misremembered after all. I can't find any documentation pointing that way.
It's just a pun on Heisenberg Uncertainty Principle.
Specifically a heisenbug (http://en.wikipedia.org/wiki/Heisenbug) is one of those annoying bugs that disappear or change under observation.
LambdaDriver
25th March 2013, 06:03
I've got a problem with avs2bdnxml in cmd line, following the tutorials and templates but whenever i try to run it i get "Only a Single input file is allowed."
my AVS script:
AVCSource("C:\Users\Graham\Working Files\3 - BD SUBBING\3 - REAuthored\00002_1_01.dga")
MaskSub("C:\Users\Graham\Working Files\3 - BD SUBBING\1 - Program Stuff\avs2bdnxml-2.05\avs2bdnxml-2.05\subs.ass",1920,1080,23.976,35160)
My avs2bdnxml comand
avs2bdnxml -t Undefined -l eng -v 1080p -f 23.976 -a1 -p1 –b1 –u0 -m3 -o ep1subs.xml ep1.avs
not sure whats going on
ps auxw
25th March 2013, 15:47
I've got a problem with avs2bdnxml in cmd line, following the tutorials and templates but whenever i try to run it i get "Only a Single input file is allowed."
my AVS script:
AVCSource("C:\Users\Graham\Working Files\3 - BD SUBBING\3 - REAuthored\00002_1_01.dga")
MaskSub("C:\Users\Graham\Working Files\3 - BD SUBBING\1 - Program Stuff\avs2bdnxml-2.05\avs2bdnxml-2.05\subs.ass",1920,1080,23.976,35160)
My avs2bdnxml comand
avs2bdnxml -t Undefined -l eng -v 1080p -f 23.976 -a1 -p1 –b1 –u0 -m3 -o ep1subs.xml ep1.avs
not sure whats going on
I'm not sure how it happened, but looking closely, it seems that the dash in front of the b1 and u0 arguments ended up as some look-alike Unicode character, not a dash. Since the arguments do not start with a proper dash, avs2bdnxml thinks you are trying to read input from three files "fakedashb1", "fakedashu0" and "ep1.avs". Try typing in the command without copy&paste and see if that helps.
sneaker_ger
25th March 2013, 18:18
And while it shouldn't cause any errors, your script's first line ("AVCSourc...") is not being used at all. MaskSub() creates its own clip.
LambdaDriver
26th March 2013, 02:10
man i feel real stupid right now, i copied most of the command from a tutorial. should have checked closer, was going nuts trying to figure out what i was doing wrong, dont use command line much. Thank you very much for the help!
also i know the ("AVCSourc...") isnt used in the subs, the line is used for previewing subs in MPC-HC
CantankerousDave
14th May 2013, 00:02
Any chance of a flag to add a SMPTE timecode offset? It's not always practical for the output to start at 01:00:00:00. BDSup2Sub lets you add a millisecond-based offset, but it doesn't support zone-based titles - and is a pain to compute.
It took a while to wrap my head around this tool, but it can do some really cool things. Thanks for creating it.
ps auxw
14th May 2013, 03:17
Any chance of a flag to add a SMPTE timecode offset? It's not always practical for the output to start at 01:00:00:00. BDSup2Sub lets you add a millisecond-based offset, but it doesn't support zone-based titles - and is a pain to compute.
Just to make sure I understand correctly: You mean a commandline flag that lets you specify an offset, which should be added to all timecodes that are output? If so, that shouldn't be hard. I'll try to get around to it soon.
It took a while to wrap my head around this tool, but it can do some really cool things. Thanks for creating it.
It's good to hear you find it useful. :)
CantankerousDave
14th May 2013, 04:55
Just to make sure I understand correctly: You mean a commandline flag that lets you specify an offset, which should be added to all timecodes that are output? If so, that shouldn't be hard. I'll try to get around to it soon.
It's good to hear you find it useful. :)
Yup, basically something that would function like the SMPTE Offset function inside MaestroSBT's Timing Properties menu that sets the zero point for the timecode calculations (as opposed to specifying the timecode you want the first event to display at).
The hardest part was remembering how to use AVIsynth. It's been a while.
ps auxw
15th May 2013, 01:57
Yup, basically something that would function like the SMPTE Offset function inside MaestroSBT's Timing Properties menu that sets the zero point for the timecode calculations (as opposed to specifying the timecode you want the first event to display at).
I have just uploaded avs2bdnxml 2.06 (http://ps-auxw.de/avs2bdnxml/avs2bdnxml-2.06.tar.bz2), which, among some other new things and fixes, has support for this. You can use the -d/--t-offset option to specify a timecode offset either in frames or as a non-drop frame timecode in the format HH:MM:SS:FF.
CantankerousDave
15th May 2013, 04:03
I have just uploaded avs2bdnxml 2.06 (http://ps-auxw.de/avs2bdnxml/avs2bdnxml-2.06.tar.bz2), which, among some other new things and fixes, has support for this. You can use the -d/--t-offset option to specify a timecode offset either in frames or as a non-drop frame timecode in the format HH:MM:SS:FF.
Hey, awesome. I'll take it for a spin and see how its timecode output compares to those in XMLs that I know to be frame accurate.
CantankerousDave
15th May 2013, 22:35
Hey, awesome. I'll take it for a spin and see how its timecode output compares to those in XMLs that I know to be frame accurate.
Hm, I'm not having any luck figuring out the proper combination to get the offset to work. With MSBT, I would set the input to 23.976fps (the framerate my video is running at in my AVS script) and an output of 24fps (using -f 24 in the CLI), add the offset, and boom.
Example - Say my ASS file starts with this line:
Dialogue: 0,0:00:21.00,0:00:22.09,Default,NTP,0000,0000,0000,,Boo!
Using settings that I know to be frame accurate, 23.976 in, 24 out, and an offset of 01:48:11:07 should produce on/off times of 01:48:32:07 and 01:48:33:09 for this line. Instead, it returns 01:48:22:08 and 01:48:23:11. Weirdly, if I try to add 9 seconds 23 frames to the offset to compensate, it returns a start value of 01:48:23:07, a difference of only 9 frames. When I use these AVS and CLI settings on a script that actually does start at 01:00:00:00, the output is perfect, so it does seem to be something with the way the offset is either calculated or added.
AVS contents:
Avisource("XXXXX.avi")
MaskSub("XXXXX.ass",1920,1080,23.976,34647)
ConvertToRGB()
CLI:
avs2bdnxml -l eng -v 1080p -f 24 -d 01:48:11:07 -a1 -p1 -b1 -o XXXXX.xml XXXXX.avs
ps auxw
15th May 2013, 22:56
Thank you for testing. That sounds really odd. It seemed to work properly when I was testing. Especially the part where 9 seconds and 23 frames end up as a 9 frame difference. I'll take a hard look at it again tomorrow and see if I can find out what's wrong.
By the way, you don't need the AviSource bit, if you enter the values directly into MaskSub like that. ConvertToRGB also shouldn't be needed.
CantankerousDave
15th May 2013, 23:37
Thank you for testing. That sounds really odd. It seemed to work properly when I was testing. Especially the part where 9 seconds and 23 frames end up as a 9 frame difference. I'll take a hard look at it again tomorrow and see if I can find out what's wrong.
By the way, you don't need the AviSource bit, if you enter the values directly into MaskSub like that. ConvertToRGB also shouldn't be needed.
Oops, that should have been 23 frames, not 9. Math fail on my part. Thanks for the tip on the AVS - it seems to process the file much faster without it. I tried it again out of curiosity, and it still returned the same values.
As for the offset issue, the first and last frames of the full 25 minute script are off by the same 9 second, 23 frame amount, so the offset is being applied consistently, it's just not being converted to the correct numerical equivalent prior to being added to the output. Is it being calculated based on the -f flag in the command line? If the calculation is defaulting to some arbitrary frame rate, that would definitely explain it.
ps auxw
16th May 2013, 17:13
Is it being calculated based on the -f flag in the command line? If the calculation is defaulting to some arbitrary frame rate, that would definitely explain it.
It's using the correct frame rate. I actually just fixed it and released 2.07 (http://ps-auxw.de/avs2bdnxml/avs2bdnxml-2.07.tar.bz2). The bug was inside the commandline parsing code. It ended up ignoring the second digit of the second field and the hours field was getting added a second time as frames. Ugh. Anyway, I tested it with your sample data and it should work now.
One more thing about the AviSynth script: You might want to specify the frame rate as 24/1.001 instead of 23.976, just to be sure.
CantankerousDave
16th May 2013, 19:19
It's using the correct frame rate. I actually just fixed it and released 2.07 (http://ps-auxw.de/avs2bdnxml/avs2bdnxml-2.07.tar.bz2). The bug was inside the commandline parsing code. It ended up ignoring the second digit of the second field and the hours field was getting added a second time as frames. Ugh. Anyway, I tested it with your sample data and it should work now.
One more thing about the AviSynth script: You might want to specify the frame rate as 24/1.001 instead of 23.976, just to be sure.
The timecode is now working perfectly (thanks for the 24/1.001 tip - I didn't know you could do that), but the PNG file names in the XML don't match those of the actual PNG files now.
For instance, the XML says:
Event Forced="False" InTC="01:59:17:01" OutTC="01:59:19:03">
<Graphic Width="724" Height="104" X="598" Y="870">00171769_0.png</Graphic>
</Event>
But the PNG containing the text that goes at that timecode is actually 00015978_0.png. The file names inside the XML seem to be taken from the new, shifted timecode while the actual output files are still based on the original, unshifted frame number.
I'm not sure which way is simpler, but it would probably be best to use the original frame numbers in both the XML and output PNGs. The frame number is handy for reference if you have the video open in VirtualDub and you don't have access to the timecode. Though it might be nice to have an option to use the name of the XML file as a base and simply number them sequentially. It's easier to keep track of what the PNGs belong to if the title of the show or movie is part of the file name. Then again, this tool makes it easy enough to re-render file sets that I guess it's not really necessary to archive the finished XML+PNG sets.
ps auxw
16th May 2013, 22:21
The timecode is now working perfectly (thanks for the 24/1.001 tip - I didn't know you could do that), but the PNG file names in the XML don't match those of the actual PNG files now.
For instance, the XML says:
Event Forced="False" InTC="01:59:17:01" OutTC="01:59:19:03">
<Graphic Width="724" Height="104" X="598" Y="870">00171769_0.png</Graphic>
</Event>
But the PNG containing the text that goes at that timecode is actually 00015978_0.png. The file names inside the XML seem to be taken from the new, shifted timecode while the actual output files are still based on the original, unshifted frame number.
I'm not sure which way is simpler, but it would probably be best to use the original frame numbers in both the XML and output PNGs. The frame number is handy for reference if you have the video open in VirtualDub and you don't have access to the timecode. Though it might be nice to have an option to use the name of the XML file as a base and simply number them sequentially. It's easier to keep track of what the PNGs belong to if the title of the show or movie is part of the file name. Then again, this tool makes it easy enough to re-render file sets that I guess it's not really necessary to archive the finished XML+PNG sets.
Oops! Well at least this one's easy to fix. This updated version (http://ps-auxw.de/avs2bdnxml/avs2bdnxml-2.08.tar.bz2) uses the original frame numbers. I might add the part about using the XML filename for a base for PNG filenames at some later point. Sorry about the buggyness.
CantankerousDave
16th May 2013, 23:07
Oops! Well at least this one's easy to fix. This updated version (http://ps-auxw.de/avs2bdnxml/avs2bdnxml-2.08.tar.bz2) uses the original frame numbers. I might add the part about using the XML filename for a base for PNG filenames at some later point. Sorry about the buggyness.
Hey, no complaints at all. It's working perfectly now, and does everything I need it to do. Thanks for the rapid turnaround especially.
The base filename thing is just something for an "It would be nice if" list, since it works fine as-is. The only other thing I can think of would probably be non-trivial, since it would involve reworking how the program parses out the input file. Basically, the ability to parse out overlapping events individually - for example, two people are talking, and a sign appears behind them that you want to flag as FORCED. Having the ability to flag the sign as Forced=TRUE without affecting the dialogue titles would be very handy indeed. Even with cropped output, overlapping events are still essentially treated as a series of full-screen events (following the same flipbook style used in fullscreen DVD and Blu-ray subtitles), so multiple titles on a single page are subject to the same FORCED=TRUE/FALSE flag. Would an authoring program reject an XML that was produced by simply reading in each line of the ASS file individually and spitting out the calculated timecode to the XML, even if it contained overlapping IN/OUT events?
ps auxw
17th May 2013, 00:10
Hey, no complaints at all. It's working perfectly now, and does everything I need it to do. Thanks for the rapid turnaround especially.
I'm glad to hear it works now.
The base filename thing is just something for an "It would be nice if" list, since it works fine as-is. The only other thing I can think of would probably be non-trivial, since it would involve reworking how the program parses out the input file. Basically, the ability to parse out overlapping events individually - for example, two people are talking, and a sign appears behind them that you want to flag as FORCED. Having the ability to flag the sign as Forced=TRUE without affecting the dialogue titles would be very handy indeed. Even with cropped output, overlapping events are still essentially treated as a series of full-screen events (following the same flipbook style used in fullscreen DVD and Blu-ray subtitles), so multiple titles on a single page are subject to the same FORCED=TRUE/FALSE flag. Would an authoring program reject an XML that was produced by simply reading in each line of the ASS file individually and spitting out the calculated timecode to the XML, even if it contained overlapping IN/OUT events?
I'm not actually sure about how authoring programs would handle overlapping events. Maybe you could make a file manually and test it. As for parsing the actual ASS file, I'd rather not do something like that, as it would reduce the generality of avs2bdnxml. Currently, it is not limited to any specific input format.
CantankerousDave
17th May 2013, 01:57
I'm glad to hear it works now.
I'm not actually sure about how authoring programs would handle overlapping events. Maybe you could make a file manually and test it. As for parsing the actual ASS file, I'd rather not do something like that, as it would reduce the generality of avs2bdnxml. Currently, it is not limited to any specific input format.
Yeah, it ought to be possible to tweak the XML file in a text editor and do it manually, but you'd have to keep track of the total number of events as you tweak the files. I *think* I saw another program that handled events that way, but it was too bare-boned to be usable.
TheSkiller
17th May 2013, 20:58
During playback of a DVD only a single subpic (subtitle) can be displayed at any time. This subpic may contain as many lines (or any other kinds of graphics) as needed but it's always just one object, hence individual subtitles cannot overlap. It's up to the authoring software to deal with it. They can be merged into a single subpic but in that case you either have everything that is contained within forced or not.
zpfbj0
7th June 2013, 17:17
Is it normal(features) or bug?
1. video format(width & height) take effect in .avs file, but useless in avs2bdnxml command option(-v)
2. video fps take effect in avs2bdnxml command option(-f), but useless in .avs file
Both of the .avs file and avs2bdnxml command option has these 2 parameters, what's the different?
ps auxw
8th June 2013, 15:57
Is it normal(features) or bug?
This is expected behavior.
1. video format(width & height) take effect in .avs file, but useless in avs2bdnxml command option(-v)
The -v option specifies the type of resolution written to the XML file. Having this separate allows you to have the AviSynth script output only a partial frame, while still getting the correct resolution in the XML file. The -x/-y options are provided to adjust the positions of the sub pictures in these cases. For example, if you have a 1080p video, but have your AviSynth script output a video with a height of 540 (just the bottom half, where you expect your subtitles), so processing is faster, you can use -y 540 -v 1080p to have avs2bdnxml produce identical output.
2. video fps take effect in avs2bdnxml command option(-f), but useless in .avs file
FPS provided by AVS are ignored. The option only accepts frame rates allowed in BDN-XML files, thus enforcing compliance. I might be a good idea to check that the AVS is providing the same frame rate specified by -f, but this might be unnecessarily restrictive, when the difference is small (e.g. rounding errors). Of course, if you use e.g. VSFilter to generate your subtitles, your AviSynth script still has to work with the correct frame rate.
Legremlins_Keitaro
22nd September 2013, 18:59
One little question, When .png file were generate, there's all have "shadow", I don't see in the avs2bdnxml.exe /? the option to disable shadow. Is it possible and How ?
TheSkiller
22nd September 2013, 21:48
Depends on what subtitle format you feed to avs2bdnxml via AviSynth.
If it's Subrip (srt) there are no styling options provided by the srt script. If it's Aegisub (ass) you can use Aegisub to style your subtitles in almost every way you could imagine.
ps auxw
22nd September 2013, 22:10
What TheSkiller said. I'm also pretty sure that Aegisub can open SRT files, so if that's what you have, you can import it there, style it and save it as ASS for further conversion.
Legremlins_Keitaro
23rd September 2013, 06:53
Hmm exact it's srt. I make a try to convert .srt to .ass with aegissub and after convert the .ass with avs2bdnxml.
Taizenshū
8th August 2015, 12:51
Sorry I don't know where to post this. But I'm have an issue with AVS2BDXML not working properly.
It was working fine before I formatted my PC (there were issues). But after formatting and installing Avisynth and VSFilter It's not working like it use to. I keep getting this:
http://i.imgur.com/mza9WEEm.png (http://i.imgur.com/mza9WEE.png)
This is my script, I have no idea what's wrong:
MaskSub("subs.ass",1920,1080,23.976,69607)
sneaker_ger
8th August 2015, 15:28
Did you try what you were told to try?
I believe a 240 frame clip is generated when an AviSynth error occurs. Try opening your .avs file in a media player. Did put (some version of) vsfilter into your AviSynth plugin autoload folder? If not, need to load it manually in your script.
Taizenshū
8th August 2015, 16:20
Did you try what you were told to try?
I did. It gave me the exact same result.
sneaker_ger
8th August 2015, 16:23
What is the error message that's shown in the media player? How does your AviSynth script look like? What vsfilter.dll version do you use and where did you put it?
Taizenshū
8th August 2015, 16:30
What is the error message that's shown in the media player? How does your AviSynth script look like? What vsfilter.dll version do you use and where did you put it?
There is no video in the script, so whenever I put it in the media player it says "Cannot render video file" (I'm using MPC).
This is how my Avisynth script looks like now:
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\VSFilter.dll")
MakeSubs("00001.ass",1920,1080,23.976,69607)
And this is what I put in cmd:
avs2bdnxml -t Undefined -l und -v 1080p -f 23.976 -a1 -p1 -b0 -m3 -u0 -e0 -n0 -z0 -o output.sup 00001.avs
I'm using VSFilter ver. 3.0.0.306 that I got from here (https://code.google.com/p/xy-vsfilter/wiki/Downloads?tm=2) and placed it in the plugins folder.
sneaker_ger
8th August 2015, 16:34
"MakeSubs"? I only know "MaskSub".
There is no video in the script, so whenever I put it in the media player it says "Cannot render video file" (I'm using MPC)
Try VirtualDub. It should show the AviSynth error message. Make sure you only use 32 bit VirtualDub or MediaPlayer to open 32 bit AviSynth. Same goes for plugins: 32 bit AviSynth can only load 32 bit vsfilter.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.