VideoHelp Forum
+ Reply to Thread
Results 1 to 18 of 18
Thread
  1. Member
    Join Date
    Feb 2014
    Location
    Texas, USA
    Search Comp PM
    I have a project to create animation video for distribution to MAC and PC users from still images, and I'm having difficulty with figuring out which software would make the most efficient workflow to achieve this. Some more details on what I'm doing: I'm using a Blender-like modeling and animation package to create TGA files for individual frames. I'm also using GIMP to create transparent overlays and static title cards. There is no audio. So my inputs are all RGB colorspace still images. My desired output is a video that can be played on both Windows and MacOS players, with minimum file size a big driver to aid in electronic distribution.

    I'll add more details of what I've tried below, but my question is, given the limitations above, what software workflow would you use to most efficiently make this work?

    The truth is that I'm overwhelmed with all the software options that can do parts of what I want, and I'm nowhere near knowledgeable enough to decide which software, in what combination would get me there efficiently. I'm hoping some of you can point me to a workflow solution.

    What I've tried:

    I've successfully used ffmpeg to create both lossless RGB (UTvideo + mkv) and lossy YV12 (libx264 + mp4) video clips from the stills with less than satisfactory compatibility results. The lossless RGB files are huge, and it seems that the most compatible colorspace is YV12. For a 60 sec clip, the RGB was ~150 MB, while the h.264+mp4 was ~600 KB; a huge difference is size. It's looking like that combination is good for both compatibility and file size, except for performance on VLC. The RGB video looks great on VLC but won't even load on WMP or Quicktime, and the YV12 looks great on WMP and Quicktime, but the colorspace is washed out on VLC.

    I've successfully used ffmpeg to add static overlays during the encoding.

    What I can't figure out:

    how to properly do the colorspace conversion so that the colors render properly on all three players. I've read on some of the doom9 forum threads that I should use avisynth to do colorspace conversion and not ffmpeg, so that would entail an ffmpeg --> avisynth --> ffmpeg chain to create lossless clips, convert colorspace, encode. Is there an easier way?

    I can't determine if ffmpeg alone can also make a TGA file into a title card. I know it can concatenate video, but I haven't seen anywhere how I might make a tga into a 10 second title at the start.

    I've looked into avisynth for creating titles and overlays, and that appears to be a possible solution, but it appears like I would have to create a lossless clip in ffmpeg first, then use something like Avanti to run an avisynth script to read in my clips and title stills, concatenate then together as video clips, then feed that to ffmpeg for encoding. I think it's doable, but I'd have to learn a lot more about avisynth scripting to create the titles and overlays.

    I could also use avisynth with VitualDub or VirtualDubMod, which appears to allow me some editing control, but I'm not sure if it will be as flexible as ffmpeg in encoding and container formats.

    A word on the final video format: I understand that perfect compatibility isn't possible, but I want to try to get something that I know will at least play correctly on Quicktime and WMP, as that's what the majority of the people receiving these videos will have. VLC would be nice as well, as there are some computer-literate users who have that. I have no problem with making two versions if it turns out that the most compatible encoding requires a different container for Windows vs. MacOS.

    If there's an all-in-one solution for this type of project I haven't seen it. The things I've tried above look like they may get me where I need to go, but they have a very steep learning curve that's kicking my butt right now. I'm hoping someone can point me to a more efficient workflow, or at least confirm that the current one I'm using (ffmpeg + Avanti/avisynth) is at least as good as any other. Commiseration is also encouraged. Thank you!
    Quote Quote  
  2. Did you post at doom10 as well ?
    http://doom10.org/index.php?topic=2901

    When you check in various players, make sure you have only 1 open at a time (only one can use hardware acceleration or overlay). That's the most common cause for levels issues

    ffmpeg will always use rec601 for RGB=>YUV conversion. So the levels RGB 0,0,0-255,255,255 => Y' 16-235 is correct (ie "TV "levels for YUV). Most players will not obey flags, and won't play full range YUV material correctly . So you don't want to use full range YUV. What' s not correct is the 601 matrix (709 is used for default HD material) - so the colors will be slightly shifted. You can use the colormatrix filter in ffmpeg to correct for that (it changes the values in YUV so as-if it had used 709 for the conversion) .It's not as good as doing it in avisynth (the quality appears to be lower - I don't know why, because it was ported from avisynth... but anyway...)

    Code:
    ffmpeg -i img%08d.tga -r 30 -pix_fmt yuv420p -vf colormatrix=bt601:bt709 -c:v libx264 -crf 18 -x264opts colorprim=bt709:transfer=bt709:colormatrix=bt709:ref=4:qpmin=4 -an out.mp4
    Last edited by poisondeathray; 13th Feb 2014 at 18:32.
    Quote Quote  
  3. Member
    Join Date
    Feb 2014
    Location
    Texas, USA
    Search Comp PM
    Yeah, that was me. It seemed like there was a lot more newbie-specific traffic here at VideoHelp, So I thought this might be a better place to ask about beginner workflow issues. This is quite helpful info, and I'll try it tomorrow.

    So if I understand then, I shouldn't expect that the players will obey the flags regarding bt709, and the players will not correctly handle a full range YUV colorspace, so I have to accept that the colorspace will be compressed to the TV range if I use YV12. My current issue with colors may be because ffmpeg is not using bt709, but it can be told to modify the colorspace after conversion to be compatible with bt709 using the colormatrix filter. But, I can get better results if I do the conversion in avisynth first. So I would do this:

    RGB stills --> ffmpeg (lossless RGB) --> avisynth (ConvertToYV12( matrix="rec709")) --> ffmpeg (encode/compress libx264/YV12) --> out.mp4

    Is that correct?

    I will try both of these approaches. unfortunately, ffmpeg just threw another wrench at me and is refusing to recognize my images as valid input. instead of 900 640x480 images, it's giving errors about a single 1877x392521 image as input, and the same command was working yesterday. I don't know what I did. I'll try to fix it and use your approach, and see what happens. I'll report back tomorrow.

    thanks!
    Quote Quote  
  4. Yes, that's correct. But if you're using avisynth, you don't have to use ffmpeg to load the tga sequence. You can use imagesource() to load the sequence directly . Ask if you need help with avisynth. For your purposes it's a simple 2 line script

    The -vf colormatrix filter for ffmpeg I mentioned above is ported from avisynth's colormatrix() filter - so it's almost the same thing (the quality is slightly worse, I don't know why but it is)

    For your ffmpeg issue, make sure the filenames are correct, and put them in quotes if there are spaces

    If you still can't figure it out post your commandline verbatim in code tags
    Quote Quote  
  5. 1) Install avisynth
    2) Write the following in notepad, change the filenames/paths to match, save it, change the extension from .txt to .avs (e.g. script.txt to script.avs)


    In this example it goes from 0-899 for 900 frames . If yours started at 1 and goes to 900, change the start and end numbers

    Code:
    ImageSource("PATH\img%08d.tga", start=0, end=899, fps=30)
    ConvertToYV12(matrix="Rec709")
    ffmpeg can be compiled with avisynth support. So you just use that avs script as input into ffmpeg

    eg.

    ffmpeg -i "script.avs" .....
    Quote Quote  
  6. Originally Posted by atesta View Post


    I can't determine if ffmpeg alone can also make a TGA file into a title card. I know it can concatenate video, but I haven't seen anywhere how I might make a tga into a 10 second title at the start.

    I've looked into avisynth for creating titles and overlays, and that appears to be a possible solution, but it appears like I would have to create a lossless clip in ffmpeg first, then use something like Avanti to run an avisynth script to read in my clips and title stills, concatenate then together as video clips, then feed that to ffmpeg for encoding. I think it's doable, but I'd have to learn a lot more about avisynth scripting to create the titles and overlays.
    I didn't answer this part directly/fully . You don't need a lossless clip in ffmpeg first. You can load image sequences into avisynth. Avspmod is the "editor" or "GUI" of sorts for avisynth. It's very very useful - you can trim clips, preview scripts, use macros etc... You can join & edit clips, overlays, alpha channel support with avisynth as well.

    I could also use avisynth with VitualDub or VirtualDubMod, which appears to allow me some editing control, but I'm not sure if it will be as flexible as ffmpeg in encoding and container formats.
    vdub can be used as well, and it has the external encoder feature, which links it to ffmpeg and any CLI encoder. Basically any format can be exported from vdub now . But if you're just using it to preview and cut with avisynth, I don't see any reason to use vdub over avspmod



    And if you're not into scripting, a fantastic little free editor is aviutl .
    https://www.videohelp.com/tools/AviUtl

    It's a layer based compositor/editor so you can do your titles and put together the clips / image sequences in there. It has many effects and hidden functions. Originally programmed in Japanese, Maverick Tse made an english translation . There are a bunch of tutorials for it if you search. It's bit quirky at first before you get used to it (if you're more familar with more traditional editors), but it's probably one of the best free editing programs IMO
    Last edited by poisondeathray; 13th Feb 2014 at 19:41.
    Quote Quote  
  7. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Couple of thoughts:

    I think you are making this more complicated than it needs to be, but can't tell because it isn't clear what your end requirements are, nor what toolset you need.

    Also "animation" means different things to different people. Some see it as equivalent to a movie or a video/clip. Some see it as a drawn/rendered, non-captured form of those.
    Is your animation to be rotoscoped/cell-drawn? Is it to be composited (beyond simple titles & transitions)?

    The way I read your OP, it sounds like all you need is to assemble/concatenate the stills into the correct order as video, and then overlay a few things, then compress to appropriate distribution format. Lots of apps can do that (alone, or in concert): Quicktime Pro, Virtualdub, WMM even (though the last would likely NOT be good cross-platform).

    But I've got to ask: why TGA? Is that all you can render as? That limits (or more truthfully, adds a layer of complexity to get around) apps' usable input format. Can't your renderer output direct to video? (not that it necessarily is a bad thing to output to stills - there are a number of good reasons for doing so) Can't it output to BMP or PNG, or even (God forbid) JPG?

    Also, what is your intended format's resolution? - SD, or HD? (or other)
    Whatever it is, you should be rendering in AT LEAST that resolution already. And you should be expecting to have need for using LOTS of space. But we can't determine your needs well, because we don't know how long your ultimate footage is intended to be either (and here you could use the standard Filesize=Bitrate*RunningTime formula as a good starting point).

    Often it is a good idea to work backwards from your destination.

    Scott
    Quote Quote  
  8. To echo Scott, please give a better description of your desired end product, because you may be reinventing the wheel here. If you're simply doing moves on stills and adding graphics you may want to look into something like Vegas Movie Studio.

    On the other hand, the chance to play with the technology may be more important to you than creating a finished product (totally legitimate either way.)
    Quote Quote  
  9. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    I also recommend AviUtl. Unfortunately it won't open an image sequence of *.tga. Your best bet is to export 32-bit or 24-bit PNG sequences and use 32-bit for alpha channel.

    AviUtl is quite amazing, I use it quite a bit for some quick high quality FX.
    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  
  10. Originally Posted by racer-x View Post
    I also recommend AviUtl. Unfortunately it won't open an image sequence of *.tga
    It does support tga, but not through drag & drop

    You right click on the seleted track => new media object => video file => reference file button => in the "files of type" dialog box, select "all files (*.*)" from the drop down menu, select the 1st image, enter the sprintif syntax (e.g. if it was img_00000.tga , img_00001.tga,.... etc... you would use img_%05d.tga )
    Quote Quote  
  11. Originally Posted by atesta View Post
    ...instead of 900 640x480 images...
    OOPS, I missed that you're dealing with SD images. If that's the case, then Rec601 is the correct matrix to use . If you're doing it in ffmpeg only, drop the colormatrix filter , and use the bt601 VUI flags. (Most media players won't read the flags, they usually behave according to the dimensions of the video - but it doesn't hurt to have them)

    Code:
    ffmpeg -i img%08d.tga -r 30 -pix_fmt yuv420p -c:v libx264 -crf 18 -x264opts colorprim=bt601:transfer=bt601:colormatrix=bt601:ref=4:qpmin=4 -an out.mp4
    For avisynth, you would change the last line to ConvertToYV12() - default is Rec601 so you can leave the matrix="Rec601" argument out. There would be no need to use avisynth IMO (unless you are doing other manipulations) , since ffmpeg can do it all for a straight conversion
    Quote Quote  
  12. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    It does support tga, but not through drag & drop

    You right click on the seleted track => new media object => video file => reference file button => in the "files of type" dialog box, select "all files (*.*)" from the drop down menu, select the 1st image, enter the sprintif syntax (e.g. if it was img_00000.tga , img_00001.tga,.... etc... you would use img_%05d.tga )
    I stand corrected........I didn't know you could enter the sprintf syntax. It works great and that's a nice trick I'll use in the future.
    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  
  13. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    I use Photoshop to create the layered PSD file where each layer will become a frame when I open the PSD file in Gif Movie Gear. I have Gif Movie Gear set up to open each layer as a frame and also to maintain 24-bit color for saving as an uncompressed AVI which is then opened in Virtualdub 1.10.4 to set the frame rate to convert to fps. I can use the fill filter in blend mode and use the curve editor to add transitions if I so desire and then use the external encoder feature in Virtualdub to save as x264 mkv or mp4. I can also add audio to the animation in Virtualdub if I want.

    It looks like the Gimp supports PSD files so the only software you would need to purchase is Gif Movie Gear for $30. It has a thirty day free trial though so you can try before you buy.
    Quote Quote  
  14. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    I use Photoshop to create the layered PSD file where each layer will become a frame when I open the PSD file in Gif Movie Gear. I have Gif Movie Gear set up to open each layer as a frame and also to maintain 24-bit color for saving as an uncompressed AVI which is then opened in Virtualdub 1.10.4 to set the frame rate to convert to fps.
    Why not just save each layer as an image numbered sequentially like 001.jpg, 002.jpg, ect. Virtualdub can open image sequences in formats it supports like jpg, tga and png ect.......
    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  
  15. Yes, image sequence would be the way to go .

    And if you're using photoshop you can save an animation as uncompressed AVI directly . I don't think gimp can
    Quote Quote  
  16. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    I'm using an old version of Photoshop that doesn't support either function.

    I was just loading the images into Virtualdub but I had issues of Vdub dropping the last couple of frames. Also, if the files aren't numbered correctly which is often the case (1...10...100...1000 instead of 0001...0010...0100...1000) then it becomes a huge task.

    I did find a script somewhere that was supposed to fix the number problem...

    Code:
    @echo off
    setlocal enableextensions enabledelayedexpansion
    rem iterate over all JPG files:
    for %%f in (*.jpg) do (
        rem store file name without extension
        set FileName=%%~nf
        rem strip the "output_"
        set FileName=!FileName:=!
        rem Add leading zeroes:
        set FileName=000!FileName!
        rem Trim to only four digits, from the end
        set FileName=!FileName:~-4!
        rem Add " " and extension again
        set FileName=!FileName!%%~xf
        rem Rename the file
        rename "%%f" "!FileName!"
    )
    Using a modern version of Photoshop and Adobe Illustrator would probably be a great option but the price of the software and the learning curve might be too much for most. I rarely create animations that consist of 100 frames or more so my workflow works well for me. I started creating animations around the turn of the century using the free Microsoft Gif Maker, MGI Photosuite that came free with a scanner I bought and a new software at the time called Virtualdub. I discovered Gif Movie Gear soon after (only $12 when I bought it) and got Photoshop 5.5 as a gift.

    This new x265 will be perfect for animations when supporting media players come out. It's a slow encoder but x264 can be pretty slow also at large resolutions and I won't be encoding a whole lot of frames. My latest x265 files are 3200x1800 at around 500KB where an equivalent x264 file would be around 2MB.
    Quote Quote  
  17. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    @DarrellS, A MAJOR problem with going the Animated GIF route you've suggested is the fact that GIF only supports 256 colors! Quite a reduction, as well as creating a compression problem later.

    It's easy to batch rename a picture sequence to follow the correct order, whether manually or automatically. Then, opening as pic sequence in Virtualdub and saving as AVI, or same in QT Pro or many countless other apps, and you're with the assembly. Then it is just a matter of overlaying a piece of video, which any decent NLE can do.

    Scott
    Quote Quote  
  18. Member
    Join Date
    Nov 2002
    Location
    United States
    Search Comp PM
    Originally Posted by Cornucopia View Post
    @DarrellS, A MAJOR problem with going the Animated GIF route you've suggested is the fact that GIF only supports 256 colors! Quite a reduction, as well as creating a compression problem later.

    It's easy to batch rename a picture sequence to follow the correct order, whether manually or automatically. Then, opening as pic sequence in Virtualdub and saving as AVI, or same in QT Pro or many countless other apps, and you're with the assembly. Then it is just a matter of overlaying a piece of video, which any decent NLE can do.

    Scott
    I'm not going the animated gif route. That's why I mentioned the "maintain 24-bit color for saving as an uncompressed AVI" under the export tab in Gif Movie Gear. You can set the speed for the whole animation or change the speed for each frame if you need some frames to stay open longer. There is also an option to open a frame in Photoshop for editing in the right click context menu.

    I wouldn't say manual renaming is easy when you have to track down every instance of 1-9 and place the appropriate number of zeros. Not sure what you mean by the next couple of sentences. Virtualdub is about the only video editor that I use (unless you count GMG which can open some AVI files). Nothing from Quicktime gets near my PC.

    Gif Movie Gear isn't a necessity but it's made life a lot easier for me. What doesn't seem necessary can save me steps down the line. A lot of times, I have Virtualdub, Photoshop and GMG open at the same time. I can copy a frame to the clipboard in VD, edit in Photoshop and paste into GMG. I can also pingpong an animation in GMG and save as SWF so the animation can play over and over. Did I mention that GMG can save the animation as sequential photo files (BMP, JPEG, PNG, PSD)?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!