Commit f4ad238c authored by Anton Khirnov's avatar Anton Khirnov

avconv: rename sameq to same_quant

It's often mistakenly used as 'same quality', emphasize that it's not
true in the manual.
parent 7478ab5a
...@@ -140,7 +140,7 @@ static int video_disable = 0; ...@@ -140,7 +140,7 @@ static int video_disable = 0;
static int video_discard = 0; static int video_discard = 0;
static unsigned int video_codec_tag = 0; static unsigned int video_codec_tag = 0;
static char *video_language = NULL; static char *video_language = NULL;
static int same_quality = 0; static int same_quant = 0;
static int do_deinterlace = 0; static int do_deinterlace = 0;
static int top_field_first = -1; static int top_field_first = -1;
static int me_threshold = 0; static int me_threshold = 0;
...@@ -1294,7 +1294,7 @@ static void do_video_out(AVFormatContext *s, ...@@ -1294,7 +1294,7 @@ static void do_video_out(AVFormatContext *s,
big_picture.top_field_first = top_field_first; big_picture.top_field_first = top_field_first;
} }
/* handles sameq here. This is not correct because it may /* handles same_quant here. This is not correct because it may
not be a global option */ not be a global option */
big_picture.quality = quality; big_picture.quality = quality;
if(!me_threshold) if(!me_threshold)
...@@ -1612,7 +1612,7 @@ static int output_packet(InputStream *ist, int ist_index, ...@@ -1612,7 +1612,7 @@ static int output_packet(InputStream *ist, int ist_index,
ret = avcodec_decode_video2(ist->st->codec, ret = avcodec_decode_video2(ist->st->codec,
&picture, &got_output, &avpkt); &picture, &got_output, &avpkt);
quality = same_quality ? picture.quality : 0; quality = same_quant ? picture.quality : 0;
if (ret < 0) if (ret < 0)
return ret; return ret;
if (!got_output) { if (!got_output) {
...@@ -1738,7 +1738,7 @@ static int output_packet(InputStream *ist, int ist_index, ...@@ -1738,7 +1738,7 @@ static int output_packet(InputStream *ist, int ist_index,
ost->st->codec->sample_aspect_ratio = ost->picref->video->pixel_aspect; ost->st->codec->sample_aspect_ratio = ost->picref->video->pixel_aspect;
#endif #endif
do_video_out(os, ost, ist, &picture, &frame_size, do_video_out(os, ost, ist, &picture, &frame_size,
same_quality ? quality : ost->st->codec->global_quality); same_quant ? quality : ost->st->codec->global_quality);
if (vstats_filename && frame_size) if (vstats_filename && frame_size)
do_video_stats(os, ost, frame_size); do_video_stats(os, ost, frame_size);
break; break;
...@@ -3239,7 +3239,7 @@ static OutputStream *new_video_stream(AVFormatContext *oc, int file_idx) ...@@ -3239,7 +3239,7 @@ static OutputStream *new_video_stream(AVFormatContext *oc, int file_idx)
if (intra_only) if (intra_only)
video_enc->gop_size = 0; video_enc->gop_size = 0;
if (video_qscale || same_quality) { if (video_qscale || same_quant) {
video_enc->flags |= CODEC_FLAG_QSCALE; video_enc->flags |= CODEC_FLAG_QSCALE;
video_enc->global_quality = FF_QP2LAMBDA * video_qscale; video_enc->global_quality = FF_QP2LAMBDA * video_qscale;
} }
...@@ -4085,7 +4085,7 @@ static const OptionDef options[] = { ...@@ -4085,7 +4085,7 @@ static const OptionDef options[] = {
{ "rc_override", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_video_rc_override_string}, "rate control override for specific intervals", "override" }, { "rc_override", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_video_rc_override_string}, "rate control override for specific intervals", "override" },
{ "vcodec", HAS_ARG | OPT_VIDEO, {(void*)opt_video_codec}, "force video codec ('copy' to copy stream)", "codec" }, { "vcodec", HAS_ARG | OPT_VIDEO, {(void*)opt_video_codec}, "force video codec ('copy' to copy stream)", "codec" },
{ "me_threshold", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_me_threshold}, "motion estimaton threshold", "threshold" }, { "me_threshold", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_me_threshold}, "motion estimaton threshold", "threshold" },
{ "sameq", OPT_BOOL | OPT_VIDEO, {(void*)&same_quality}, { "same_quant", OPT_BOOL | OPT_VIDEO, {(void*)&same_quant},
"use same quantizer as source (implies VBR)" }, "use same quantizer as source (implies VBR)" },
{ "pass", HAS_ARG | OPT_VIDEO, {(void*)opt_pass}, "select the pass number (1 or 2)", "n" }, { "pass", HAS_ARG | OPT_VIDEO, {(void*)opt_pass}, "select the pass number (1 or 2)", "n" },
{ "passlogfile", HAS_ARG | OPT_STRING | OPT_VIDEO, {(void*)&pass_logfilename_prefix}, "select two pass log file name prefix", "prefix" }, { "passlogfile", HAS_ARG | OPT_STRING | OPT_VIDEO, {(void*)&pass_logfilename_prefix}, "select two pass log file name prefix", "prefix" },
......
...@@ -308,9 +308,12 @@ It is of little use elsewise. ...@@ -308,9 +308,12 @@ It is of little use elsewise.
Set video buffer verifier buffer size (in bits). Set video buffer verifier buffer size (in bits).
@item -vcodec @var{codec} @item -vcodec @var{codec}
Set the video codec. This is an alias for @code{-codec:v}. Set the video codec. This is an alias for @code{-codec:v}.
@item -sameq @item -same_quant
Use same quantizer as source (implies VBR). Use same quantizer as source (implies VBR).
Note that this is NOT SAME QUALITY. Do not use this option unless you know you
need it.
@item -pass @var{n} @item -pass @var{n}
Select the pass number (1 or 2). It is used to do two-pass Select the pass number (1 or 2). It is used to do two-pass
video encoding. The statistics of the video are recorded in the first video encoding. The statistics of the video are recorded in the first
...@@ -848,11 +851,6 @@ To have a constant quality (but a variable bitrate), use the option ...@@ -848,11 +851,6 @@ To have a constant quality (but a variable bitrate), use the option
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst '-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
quality). quality).
@item
When converting video files, you can use the '-sameq' option which
uses the same quality factor in the encoder as in the decoder.
It allows almost lossless encoding.
@end itemize @end itemize
@c man end TIPS @c man end TIPS
......
...@@ -58,7 +58,7 @@ do_video_decoding ...@@ -58,7 +58,7 @@ do_video_decoding
# mpeg2 encoding interlaced # mpeg2 encoding interlaced
file=${outfile}mpeg2reuse.mpg file=${outfile}mpeg2reuse.mpg
do_avconv $file $DEC_OPTS -me_threshold 256 -i ${target_path}/${outfile}mpeg2thread.mpg $ENC_OPTS -sameq -me_threshold 256 -mb_threshold 1024 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4 do_avconv $file $DEC_OPTS -me_threshold 256 -i ${target_path}/${outfile}mpeg2thread.mpg $ENC_OPTS -same_quant -me_threshold 256 -mb_threshold 1024 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -threads 4
do_video_decoding do_video_decoding
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment