Monday 5 November 2018

windows 7 - Encode HD video to a good format for editing


I have a video that I would like to edit, but it's currently a mov (H.264) file, which makes frame by frame editing impossible. So, I'd like to re-encode it to a better format. I read that DV is a good format for frame by frame editing, but when I've tried to do so I find that I lose resolution. My video is 1280x720, but the DV video comes out at only 720x480.


I've been playing with mencoder, ffmpeg, and winff on a Windows machine. So many of the command line arguments are over my head! I just want to preserve the settings from the original and get out a high quality video that is good for editing frame by frame. Can you point me to the right codec (and how to install it), the best tool, and the command line arguments to use?


This worked great for AVI:


mencoder -oac pcm -ovc x264 -o myvid.avi myvid.mov

What do I need for HD and editable? Something like this?


mencoder -oac pcm -ovc ??? -o myvid.??? myvid.mov

Answer



What you are looking for is probably a so-called intermediate codec that is specifically targeted towards editing. It will allow you to perform a (visually) lossless compression but still make changes to the video without reasonable quality loss. Just like JPEG isn't made for resaving a photo a hundred times, you will need a special codec.


Your approach with DV wasn't that bad. The only problem is that the DV standard only specifies a maximum resolution of 640x480 pixels.


HuffYUV


I'd suggest you try HuffYUV, which is a lossless codec that is relatively fast and should be easily editable on Windows platforms. On Linux and OS X it's not the best choice though. ffmpeg has HuffYUV support built in, so you don't need to install anything else. You can try something like:


ffmpeg -i infile.mov -vcodec huffyuv -acodec copy outfile.avi

You shouldn't need to specify the frame size or anything. Just give it a try. The advantage is that it saves the video frame-by-frame, which is what you want for editing.


MPEG2


Another alternative is to convert to MPEG2 using only intra-coded frames. Intra-coded meaning that every frame is fully coded. MPEG2 is not really that useful as an intermediate codec, but it's still used for professional video transmission and storage.


ffmpeg -i infile.mov -vcodec mpeg2video -qscale 1 -qmin 1 -intra -an outfile.m2v

Note that you could get a really huge file. MPEG2 should be easy to edit though, as it's a very basic codec.


DNxHD


DNxHD is a visually lossless intermediate codec by Avid. There are ffmpeg versions that can encode to DNxHD. For example, ffmbc is a specialized ffmpeg version targeted towards video broadcasting.


ffmpeg -i infile.mov -vcodec dnxhd -b  -an output.mov

See this table for bitrates to be used. You might not be able to open the result file with every editor. You'd also need to have the decoder plugin installed. I've personally used it with Premiere Pro on a Mac and it's a really good codec.


If you have any issues, let me know.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...