PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Embed (not load at runtime) SWF in SWF? Or other suggestions pre convert to video?
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Embed (not load at runtime) SWF in SWF? Or other suggestions pre convert to video?

  1. #1
    Senior Member
    Join Date
    Feb 2008
    Posts
    107

    Embed (not load at runtime) SWF in SWF? Or other suggestions pre convert to video?

    I'm loading a SWF (essentially a video, without titles) into an AS 3 (Flash) project, adding titles (multiple passes, in multiple different languages), and exporting each language version as an SWF. The exported SWF is much smaller than it should be, and I realize it isn't incorporating the loaded SWF into itself, it's still loading it at runtime.

    I'd like to embed/not load at runtime if possible. The reason is these all need to be converted to video and I suspect that process works best with a self-contained SWF, not one that has to load other SWFs. Maybe that's not the case. I haven't yet figured out how to convert to video. It seems like there are a hundred sites trying to sell you their SWF-to-video tool, haven't gotten around to trying to figure out which actually work. Maybe they are smart enough to deal with the external video, as well as the likely delay at the start as the container SWF loads the base SWF.

    Any advice greatly appreciated!

    - Bob

  2. #2
    Member
    Join Date
    May 2012
    Posts
    51
    Seems like you're using the wrong tool for the job. It would be a whole lot easier to do the video composition in After Effects.

  3. #3
    Senior Member
    Join Date
    Feb 2008
    Posts
    107
    Is there a way with After Effects to feed in a separate "titles" file, with start time, duration and text for each title? It'd be a simple text or xml file. If that would work we could skip the Flash step. As you suggest, there's not much reason to use Flash.

    Unfortunately I don't have After Effects but could probably track down someone who does.

  4. #4
    Member
    Join Date
    May 2012
    Posts
    51
    After Effect is fully scriptable. Here's the link to the latest reference guide:

    http://blogs.adobe.com/toddkopriva/f...ting-Guide.pdf

    A script that does what you want will look something like this:

    Actionscript Code:
    if(app.project != null) {
        var comp = app.project.activeItem;
        if(comp instanceof CompItem) {
            var textFile = File.openDialog("Select a text file");
            if(textFile) {
                textFile.open("r");
                while(!textFile.eof) {
                    var line = textFile.readln();
                    var re = /\[(\d+)-(\d+)\]\s*(.*)/;
                    var matches = re.exec(line);
                    if(matches) {
                        var startTime = parseFloat(matches[1]);
                        var endTime = parseFloat(matches[2]);
                        var text = matches[3];
                       
                        var layer = comp.layers.addText();
                        var source = layer.property("sourceText");
                        var document = new TextDocument(text);
                        source.setValueAtTime(0, document);
                        layer.startTime = startTime;
                        layer.outPoint = endTime;
                    }
                }
                textFile.close();
            }
        }
    }

    The code reads each line in a plain text and looks for a start and end time at the beginning. It then creates a new text layer.

  5. #5
    Senior Member
    Join Date
    Feb 2008
    Posts
    107
    I'm not able to locate anyone with After Effects (or at least anyone who is willing to take on this project). So I'm back to converting SWF to mp4. I will post this as a new question.

  6. #6
    Member
    Join Date
    May 2012
    Posts
    51
    Another solution is to create a SubStation Alpha subtitle file and then burn the subtitles into the video. There are some fairly decent open source programs you can use--at least on Windows. Aegisub can be used to edit the subtitles while VirtualDub is a common choice for video encoding.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center