<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi,<div><br></div><div>Thanks for all your responses, it makes things clearer. So if I understand, I can't encode video without losing quality (the same with decoding, but I don't actually have problems with decoding). But I can't skip decoding  for processing reasons. So how to define the encoding tweaks which will minimize the lost of quality ? Is there a function like AVOutputFormat* defineBestDecodeSettings(AVPacket *pkt, enum AVQuality flags); ?<br><br><div style="text-align:center;"><span style="font-size: 12pt;">Sincerely</span>,</div><div style="text-align:left;">Guillaume Bersac</div><div style="text-align:left;">237bis rue de Pessac</div><div style="text-align:left;">33000 Bordeaux</div><div style="text-align:left;">06.65.30.89.43</div><div><br></div><br><br><div>> Date: Sun, 23 Jun 2013 23:49:17 +0300<br>> From: alexcohn@netvision.net.il<br>> To: libav-user@ffmpeg.org<br>> Subject: Re: [Libav-user] What define the quality of a decoded video<br>> <br>> On Fri, Jun 21, 2013 at 5:45 PM, Guillaume Bersac <bersac_1@hotmail.fr> wrote:<br>> > HI,<br>> ><br>> > I have a basic .avi video. I decode it, reencode it using the same type of<br>> > encoder without modifying the decoded data and finally I save it on one file<br>> > of my computer. The saved video has a good framerate but it had lost a lot<br>> > of quality in the process (it's now with a lot of pixel). I kwon that the<br>> > image has been decoded without losing quality. The lost of quality appeared<br>> > during the decoding and saving process.<br>> > What define the quality of a decoded video ?<br>> ><br>> > Thanks,<br>> > Guillaume Bersac<br>> > 237bis rue de Pessac<br>> > 33000 Bordeaux<br>> > 06.65.30.89.43<br>> <br>> The quality was lost because of re-encoding. Video encoders involve<br>> irreversible transformations, e.g. quantization. Applying this kind of<br>> transformation several times may easily result in bad visual.<br>> <br>> Luckily, you don't need to go through this process if your goal is to<br>> store some video file in a different format. ffmpeg accepts "-vcodec<br>> copy" parameter, which will bypass decoding and re-encoding, and keep<br>> the quality of the original. Same can be easily achieved<br>> programmatically using libavformat and libavcodec, if you are writing<br>> your program (implied by your posting to the libav-user list, and not<br>> to ffmpeg-user list).<br>> <br>> Note however that not all container formats are compatible with all<br>> codecs, so in some use cases "-vcodec copy" is invalid.<br>> <br>> Sincerely,<br>> Alex<br>> _______________________________________________<br>> Libav-user mailing list<br>> Libav-user@ffmpeg.org<br>> http://ffmpeg.org/mailman/listinfo/libav-user<br></div></div>                                      </div></body>
</html>