Package: ass2rythmo
ass2rythmo is a converter which generate rythmo band out of subtitles in ASS (Advanced SubStation) format.Rythmo bands are used to provide synchronized script for voice actors when dubbing a video.The text scrolls at a constant speed but has a variable width to adapt to the speech flow that needs to be recorded to be synchronised with lips on screen.InstallationAss2Rythmo can be installed from pip:pip install ass2rythmoAlternatively, Ass2Rythmo can be run directly from sources after a git pull:git clone https://gitlab.com/zeograd/ass2rythmo.git
cd ass2rythmo && python setup.py installUsageFirst, generate a timed ASS subtitle file including only the part having to be said by actors.Then, generate the rythmo band as as collection of transparent png files:ass2rythmo my_video_script.ass -R 30or as atransparentmovie if you haveffmpegavailable:ass2rythmo my_video_script.ass -R 30 -r rythmo_band.movor asopaquemovie, still withffmpegavailable:ass2rythmo my_video_script.ass -R 30 -r rythmo_band.mp4Don’t forget to specify the frame rate of the video on which the png will be superposed to ensure a correct synchronisation.By default, this will generate png file in the current directory named 00000.png, 00001.png, etc…
You can change the directory in which the png files are generated by providing a pattern to the-rargument including percent sign
(/tmp/%05d.pngfor instance, for generating png in the/tmpdirectory and padding the frame number on 5 digits.)If you specify a pattern without any percent sign, it will be considered as a
single movie file output filename.
The result will be encoded withFFV1codec andmovcontainer if the extension
of the output file ismov.If you use another extension, the default ffmpeg rule will apply. Typically you
may want ah264encoded movie in amp4container by asking for an output
filename ending inmp4.Then you can burn the png sequence on top of your movie using your favorite video editor. You can also useffmpegto perform a quick overlaying, with a command similar to:ffmpeg -i input.mp4 -framerate 30 -i %05d.png -filter_complex "overlay=:main_h-overlay_h" output.mp4to do the same with a transparent mov rythmo band, use something like:ffmpeg -i input.mp4 -i rythmo_band.mov -filter_complex "overlay=:main_h-overlay_h" output.mp4Script creationUse any ASS compatible tool, likeAegisub.You can use the regular { } to include comments or alternatively [ ] to include content which won’t appear in the rythmo band (but still be present if you burn the ass file onto a video, like for actor direction hints).The bundled font was chosen so that you can include unicode character to show which kind of intonation change you’d like (using unicode arrows).You can fine tune a single sentence timing using the karaoke tags. You don’t have to split your script for the sake of introducing a pause or changing the pace between 2 parts of a sentence.
In this case, you can preview the speed at which every part of your sentence will be rendered using/kfinstead of the default/ktags (both will be accepted byass2rythmo,/kois also working)Obviously, take care of synchronizing carefully your subtitles with the lips on screen to ensure that recording according to the rythmo band will be synchronized with the images.You can disable rendering rythmo band for anactorby including[norythmo]in its name.CLIThe CLIass2rythmoincludes sensible default values.
You should be careful about setting the correct frame rate with-Roption.You may want to alter the generated width to use fully your available room with-Wand also change the scroll speed with-D.Other options are less often useful and documented below.usage: ass2rythmo [-h] [-d] [-v] [-W TARGET_WIDTH] [-H TARGET_HEIGHT][-R TARGET_FPS] [-F FONT_FILENAME] [-D SCROLL_DURATION]
[-r RESULT_FILENAME_FORMAT] [-s SYNC_POINT_RATIO]
ass_filenameGPL v3+ 2018 Olivier Jollypositional arguments:ass_filename          input file as Ass formatoptional arguments:-h,--helpshow this help message and exit-d,--debugprint debugging info [default: False]-v,--versionshow program’s version number and exit-WTARGET_WIDTH,--target_widthTARGET_WIDTHWidth of the generated png files [default: 1920]-HTARGET_HEIGHT,--target_heightTARGET_HEIGHTHeight of the generated png files. Note that it’s not
meant to support low heights at this time [default:
380]-RTARGET_FPS,--target_fpsTARGET_FPSFrame per second to generate. Make sure it matches
your subbed video ! [default: 30]-FFONT_FILENAME,--font_faceFONT_FILENAMEFilename of the font used to generate text [default:
[install path]/DejaVuSans.ttf]-DSCROLL_DURATION,--scroll_durationSCROLL_DURATIONDuration of width traversal in ms [default: 4000]-rRESULT_FILENAME_FORMAT,--result_filename_formatRESULT_FILENAME_FORMATFilename template for generated files. May include
directory part but won’t create any. Including % in
the format will generate a list of png files else will
generate a transparent movie with the help of ffmpeg
[default: %05d.png]-sSYNC_POINT_RATIO,--sync_point_ratioSYNC_POINT_RATIOPosition of the sync point on screen, 0 is leftmost, 1
is rightmost [default: 0.15]Convert ASS subtitles to rythmo band as list of transparent png or single transparent movieLIMITATIONSThis program is quite young and not extensively tested. Notably, it was only run under linux so far, but no OS specificity were used.The rendering is done on 2 lines maximum. So with 3 actors speaking at the same time, there will be some overlayed text above each other.Some artefacts may appear on the leftmost part of short text chunk for some characters (like a “I” to be pronounced very quickly at the beginning of a text chunk).LICENSEThe ass2rythmo code itself is licensed under GPL V3+ and the bundled DejaVu font is licensed under its own free License (cf LICENCE-dejavu.txt).