Export .MOV?

KoDuty
KoDuty Website User Posts: 111
edited October 2015 in Post-production techniques

I want to export some transparent layers so.. Is there any way that I can export .MOV video?

«1

Comments

  • Triem23
    Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 19,021 Ambassador

    Not on Hitfilm 3 on Windows. Rendering PNG or Open EXR image sequences will preserve alpha. Make certain the RGB/RGBA field on the Export screen is set to RGBA. 

    If you jave Vegas it can re render the image sequence to MOV. Otherwise free software like VirtualDub or Mpeg Streamclip can do it. 

  • KoDuty
    KoDuty Website User Posts: 111

    thanks u so much!:>

  • AxelWilkinson
    AxelWilkinson Staff Administrator, Imerge Beta Tester, HitFilm Beta Tester Posts: 5,247 Staff

    Uncompressed AVI also supports alpha export on a Windows machine.

  • KoDuty
    KoDuty Website User Posts: 111

    But AVI seems so large file :<

  • Triem23
    Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 19,021 Ambassador

    Uncompressed AVI will be very large files, yes. That said, the folders of a PNG or OPEN EXR sequence will be as large as the uncompressed AVI (not quite true--the PNG sequence should be about half the size).

  • HitFilmer57341
    HitFilmer57341 Website User Posts: 70 Enthusiast

    cant find the right link now about quicktime problem , but I unistalled it restarted pc and it works fine now

  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,509 Enthusiast

    If you really need an MOV, export to a PNG sequence and then use FFMpeg to wrap that sequence to an MOV

    ffmpeg.exe  -thread_queue_size 512 -framerate 29.97 -i image%06d.png -map 0:0 -c:v copy -flags global_header output.mov

  • Pencilandinc
    Pencilandinc Website User Posts: 143
    edited November 2015

    Aladdin4d, thanks you for posting that solution. As someone who uses Windows, OS X, and Linux, I only just recently found out that the newer versions of ffMpeg would export not only to MOV, but to ProRes as well.

    I am, however, not well versed in the programming code required to run ffMpeg and would like, if permitted, to post a link for a product I recently bought to make my workflow a lot smoother. Granted, it is realized that there are free solutions available that do the same thing but, for me, I found this interface easier to work with and it only costs 17.50 euros, or--in my translation--19.56 USD. It's called MyFFmpeg and can be found here:  http://www.myffmpeg.com/index.html

    MyFFmpeg's function is to act as an interface that writes the code for users such as myself who never really were able to wrap their heads around writing the code to run ffMpeg.

    Hope this helps.

  • Stargazer54
    Stargazer54 Moderator Moderator, Website User, Ambassador, HitFilm Beta Tester Posts: 3,014 Ambassador

    @Pencilandinc Nice find on the MyFFMpeg frontend.  Pretty slick!

  • Pencilandinc
    Pencilandinc Website User Posts: 143

     Thanks, Stargazer. Hope it helped. 

  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,509 Enthusiast

    @Pencilandinc That is a pretty slick front end for FFMpeg and being able to see and edit the command line options it's parsing to FFMpeg is a nice touch.

  • Pencilandinc
    Pencilandinc Website User Posts: 143

    Thanks, Aladdin 4d. Hopefully it allows everyone working in Windows the flexibility to export to ProRes from image sequences. I have yet to try exporting an uncompressed AVI with an alpha channel from HitFilm and trying to filter it through MyFFmpeg to get a ProRes 4444 file. Don't even know if it would work in theory.

  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,509 Enthusiast

    It would work but it's extra work, takes longer,  risks more encoding artifacts and it doesn't really gain you anything over just wrapping the PNG sequence to an MOV.  

  • Triem23
    Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 19,021 Ambassador

    In fact, there are several disadvantages to rendering uncompressed AVI: first, a PNG sequence will have all the image fidelity of the AVI, but, since PNG is a compressed format, the image sequence will take half the disc space of the AVI. Second, the image sequence will render significantly faster--each frame is a file that's written and closed, freeing up resources for render, where the AVI file is always being kept open and active. Image sequences also render faster than Mp4, Quicktime and direct YouTube uploads. Third, if something goes wrong on render (power failure, computer crash, render error), with the image sequence you can pick up the render where it left off--the AVI has to be redone from scratch. Fourth, while overlooked, image editing tools like Photoshop and Gimp can be used to batch process the output. There are cool things you can do with Photoshop that NO NLE does, but Photoshop doesn't like uncompressed AVI... Finally, I note that the big FX houses for TV/Film generally render everything as image sequences for the reasons I discuss above. 

    The bottom line is a PNG image sequence is your second-best quality Hitfilm output. Best Quality is Open EXR image sequences... But only if you are bouncing to another program for 16-bit/channel edits/grading. In every other case, PNG is the way to go. 

  • NormanPCN
    NormanPCN Website User Posts: 4,063 Enthusiast

    +1 for the PNG sequence. It would be very nice if Hitfilm could also generate a WAV file for audio when rendering the image sequence. At least have an audio only WAV file render option. Some way to have an audio file to go with the image sequence. Rendering AVI, audio only, and then extracting the PCM audio is clunky at best.

  • CedricBonnier
    CedricBonnier Staff Administrator, HitFilm Beta Tester Posts: 1,192 Staff

    Hi guys, adding audio only export options is on our (very long) list of things to do.

    I don't think this got mentioned here but another way of getting an audio file from HitFilm is to export audio only  in the H.264 tab then when selecting the file name type "fileName.m4a". This will create an AAC encoded audio file. Granted that it is a lossy encoding but it is another option.

  • Triem23
    Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 19,021 Ambassador

    Does the same trick work exporting AVI audio only and naming the render >filename<.wav?

    That's a good tip on the AAC. Thanks! 

  • CedricBonnier
    CedricBonnier Staff Administrator, HitFilm Beta Tester Posts: 1,192 Staff

    @Triem23 Unfortunately not, exporting audio only AVI creates a PCM encoded audio stream in an AVI container. It is similar to what the H.264 tab does: creating an AAC encoded audio stream in an MP4 container. m4a is just a mp4 with a different file extension but it is probably easier to import in other softwares than an audio only mp4.

  • Pencilandinc
    Pencilandinc Website User Posts: 143

    The export of synchronized audio was the ONLY reason that I was willing to entertain the thought of going from uncompressed AVI to MOV. I generally work in Blender so the majority of what I do is in PNG sequences.

    I love what is possible with VFX and editing in HitFilm and was hoping to be able to output a final product in HitFilm and MyFFmpeg to ProRes on Windows when away from my desktop Mac and on my Toshiba laptop. Guess not.

  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,509 Enthusiast

    @Pencilandinc I'm not on my computer at the moment and I don't trust my ffmpeg foo enough to write out a command line on the fly but the process I've done quite a few times now is:

    1. Render the image sequence
    2. Export an audio only AVI. To get this just uncheck the Export Video option under the AVI tab. Rendering audio only goes very fast so it won't take long at all
    3. Use FFmpeg to take the audio from the AVI and the image sequence and wrap it to an MOV. This also goes pretty quick and can be done in a single command line without having to extract the audio from the AVI first.

    It would be nice if HitFilm could go ahead and just export a WAV file at the same time as an image sequence as it would save a couple of steps but as it is it's just a minor annoyance to me. 

    I have not paid for MyFFMpeg and I haven't tried this in the trial yet to see if it's possible but even if it isn't you can set up a bat file to do it which is what I did and why I don't remember every command line option :) Keep an eye out here and I'll post a working command sequence soon.

     

  • NormanPCN
    NormanPCN Website User Posts: 4,063 Enthusiast

    Maybe something like this to remux a hitfilm PNG seq and AVI audio only to a MOV keeping the PNG sequence. The PNG input name has to be adjusted since Hitfilm puts out a variable number of leading zeros depending on the frames being rendered. Also choose your appropriate frame rate.

    ffmpeg.exe -i d:\renders\png\image%%02d.png -i d:\renders\audio.avi -c:v png -r 30000/1001 -c:a copy -chunk_size 64K d:\renders\output.mov

    And then something like this to encode the PNG sequence to ProRes.

    ffmpeg.exe -i d:\renders\png\image%%02d.png -i d:\renders\audio.avi -c:v prores_ks -profile:v standard -pix_fmt yuv422p10le -r 30000/1001 -c:a pcm_s16le -chunk_size 128K d:\renders\output.mov

  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,509 Enthusiast
    edited November 2015

    You beat me to it NormanPCN but this is what I use to get to an MOV

    ffmpeg.exe -thread_queue_size 512 -f image2 -framerate 29.97 -i image%%03d.png -channel_layout
    stereo -i audio.avi -map 0:0 -map 1:0 -c:v copy -c:a copy -flags global_header output.mov

    Modified to use the default FFMpeg location of MyFFMpeg for use in a bat file:

    %APPDATA%\myffmpeg\ffmpeg.exe -thread_queue_size 512 -f image2 -framerate 29.97 -i image%%03d.png -channel_layout
    stereo -i audio.avi -map 0:0 -map 1:0 -c:v copy -c:a copy -flags global_header output.mov

    To explain the important bits somewhat:

    • %APPDATA% This is Windows environment variable that points to C:\Users\{username}\AppData\Roaming. There are several others that can be very useful for bat files. Windows Environment Variables
    • -thread_queue_size Basically a buffer for queuing packets. The default size is 8 and increasing to 512 seems to be common practice
    • -framerate sets the input framerate and should match your project. If not set FFMpeg defaults to 25 fps
    • -f image2 tells FFMpeg it's dealing with an image sequence. Not necessarily needed but apparently there are situations where it's required so probably a "best practice" to use it.
    • -i image%%03d.png This inputs the image sequence and needs to be changed depending on how many frames were rendered. -i is FFMpeg shorthand for Input. image is the file name prefix. HitFilm defaults to "image" but if you use another name change this to match. %%03d This sets the number of digits for the numeric sequence and as NormanPCN pointed out that changes depending on the number of frames being rendered. This example is good for up to 999 frames beginning with 000. For up to 99 frames it would be %02d and for up to 9999 frames it would be %04d. The extra % at the beginning is for Windows only and you won't see it in most FFMpeg documentation. The % is a reserved character for variables in the Windows shell and if you use just one % then Windows will inject the name of your bat file in its place. The fix to escape the variable trap is to use %% so keep in mind whenever you see % in FFMpeg examples it should be %% in Windows.
    • -channel_layout Pretty self explanatory and not strictly needed for stereo audio but it is necessary for dealing with multi-channel audio or separate audio streams so think of it as another best practice.
    • -map These map the streams and really shouldn't be necessary but I ran into compatibility problems until I added them so go figure.
    • -c:v copy -c:a copy This is telling FFMpeg to copy the video and audio streams
    • -flags global_header MOV is a container type that requires a global header as opposed to individual packet headers. An MOV generated without this flag would probably still work but FFMpeg will give you a warning about the issue. This makes sure you have a global header and eliminates the warning,

     

     

  • NormanPCN
    NormanPCN Website User Posts: 4,063 Enthusiast

    "You beat me to it NormanPCN"

    Well, I've never done image sequences with ffmpeg so I thought it would be fun to give it a try. My ffmpeg experience is mostly from frameserving from Vegas to ffmpeg. Mostly for x264 AVC/H.264 encoding, but also ProRes once. x264 giving better quality and MUCH greater speed than the Mainconcept AVC encoder Vegas and also Hitfilm use.

    Regarding Hitfilm and image sequence renders. On my machine OpenEXR with the default PIZ compression renders 3x faster than PNG. The files are bigger of course as they are 16-bit, but they are not 2x bigger. ffmpeg does understand EXR.

     

  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,509 Enthusiast

    @NormanPCN just a some thoughts....without the -framerate flag set FFMpeg assumes the image sequence is 25 fps so when you later set an output frame rate with -r you'll get a rate conversion (unless the output rate is 25 of course)

    Qscale is supported by the ProRes encoder so you could add -qscale:v [number] where number is between 0 and 32 (or 31 can't remember) with 0 being absolute "best" 9-13 seems to be the "sweet" range with anything under 5 not giving you anything more except outrageous file sizes. 

    I thought -chunk_size and -chunk_duration were mp4 only options? Curious about that now

    Since you seem to be primarily a Windows guy it won't make much difference to you (and things may have changed) but for compatibility with Final Cut, Quicktime Mac and all other things Apple only there's a -vendor flag that needs to be set for ProRes -vendor ap10

    Are you sure FFMpeg still doesn't support EXR? I know there was something added about 3 years ago and there were problems but I would've thought that would be straightened out by now. I haven't tried at all or even checked up on it. Not that I'm criticizing what they do or how they do it but the developer crowd for FFMpeg seem a bit odd to me and make my brain hurt whenever I try to find an answer to something. 

  • Triem23
    Triem23 Moderator Moderator, Website User, Ambassador, Imerge Beta Tester, HitFilm Beta Tester Posts: 19,021 Ambassador

    For better or worse, isn't FFMpeg open-source and developed by volunteers? Development quirks can abound. 

    The chunk size/duration flag would be common to any Long-GOP codec, including all Mpeg variations (h. 264) and certain Quicktime versions. 

  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,509 Enthusiast

    Okay so tried OpenEXR with FFMpeg and got some weird results so I'm thinking exr support is still broken. I have another idea or two but I'm done for tonight so see ya on the flip side

  • NormanPCN
    NormanPCN Website User Posts: 4,063 Enthusiast
    edited November 2015

    Chunksize is just info for the muxer. MP4 and MOV are near identical twins. MP4 being based on Quicktime. ffmpeg has a very small chunksize by default. That works but can be less I/O efficient, by requiring more I/O ops per second. For ProRes this is one of the things Apple products complained about with ffmpeg encodings. Apple expected chunks to be about 48K audio samples is size.

    Aladdin4d, thanks for the tip about the placement of the framerate setting.

    I tried an OpenExr encode in ffmpeg and the colors were WAY off. PNG was okay, but then I was reminded of the notorious ffmpeg issue. RGB -> YUV conversions. PNG, EXR and even AVI uncompressed. You do not want ffmpeg to do this RGB to YUV conversion. The conversion is hard coded to a 601 matrix. While you can later correct that to 709 with the colormatrix filter, that is a loss. Not ideal, but also the ffmpeg code that does the conversion, swscale, was (is?) restricted to 4:2:0 and 8-bit. Not a big deal if you output target is 420 but ProRes, DNxHD and other HQ intermediates are normally 422.

    With my frameserving from Vegas to ffmpeg I ran into this while testing my conversions with a Belle Nuit chart. The frameserve via VfW is RGB and I ended up doing the RGB to YUV conversion in Avisynth which is required for the frameserve anyway. Perfect control with a perfect conversion.

  • Pencilandinc
    Pencilandinc Website User Posts: 143

    Wow. As a student of animation, I thank you all for your input. I come up here to gain insight on techniques and technologies and you all have definitely shared that. Again, thank you.

  • Aladdin4d
    Aladdin4d Moderator Website User, Imerge Beta Tester Posts: 2,509 Enthusiast

    @NormanPCN Thanks for reminding me of that particular "feature" of FFMpeg! Vapoursynth with the ImageMagick and format convert plugins handles OpenEXR and the output pipes natively to FFMpeg avoiding the issue too.

  • NormanPCN
    NormanPCN Website User Posts: 4,063 Enthusiast

    @Aladdin4d A -gamma 2.2 EXR input switch gets ffmpeg properly going on EXR output from Hitfilm, but I see problems with areas that are clipped min/max values. Like some portions of clouds in some GoPro video, and a Belle Nuit chart EXR rendered from Hitfilm goes bonkers in ffmpeg.  Vegas handles the EXR fine, so it seems ffmpeg has some boundary condition issues on 16-bit float EXR. Sans boundary condition issues, at first glance it looks fine.

    Of course the RGB->YUV thing is always there. Since Avisynth is tied to VfW we can't use it to do the YUV conversion on EXR files. I'll have to look into this Vapoursynth tool you just mentioned.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!