# How to re-encode video without losing quality

I finished rendering an animation with audio into the default H.264 lossy settings. I then realized the audio was 1 frame off and I also altered the song that I used in the video. So my two questions are:

1. Is it possible to re encode the video with lossy compression after shifting the frames back, but have blender automatically use the same keyframes and what not, so that more quality is not lost?

2. If one is not possible, if I don't shift the frames and leave the video portion the exact same, but change the audio, is it possible to not lose quality by using the same lossy H.264 settings?

Some clarifications:

–I know I could render it with "Lossless" Checked, but I still want compression for the small file size –Often I render it into an image sequence first since it is a good practice. I still would like to know this information in the case that I delete the raw images like in this case

• Mar 3 '16 at 20:26

## 1 Answer

The first option isn't a possibility. The second one, however, is. You should be able to de-multiplex the audio and video track and then re-package new audio with the video. FFMPEG is the program that I tend to use for this kind of task, but you'll need to be comfortable working from the command line. Depending on the OS you use, there may be easier tools for this.

• This would be done with the -c:v copy flag nowadays, which copies the video across containers verbatim. Nov 26 '15 at 13:05