slawek
slawek

Reputation: 55

Problems with setting constant bitrate by using avconv

I have troubles with setting constant output bitrate. Every time I try I am getting same bitrate as input (I wanna downrate the file)

As input I have MPEG2/MPEG-A file.mpg with VBR 10Mb As output I want MPEG2/MPEG-A file.ts with CBR 8Mb

avconv -i file.mpg -codec copy -b 8M -maxrate 8M -minrate 8M -bufsize 4M -f mpegts file.ts

Is there something wrong there? Can you suggest me better parameters so I can get better output quality?

Upvotes: 1

Views: 5094

Answers (1)

slhck
slhck

Reputation: 38701

-codec copy tells avconv to just copy the first video, audio and subtitle bitstream of the input to the output. There will be no re-encoding, so any of -b, -maxrate, -minrate or -bufsize don't make sense.

So:

  1. Remove -codec copy.
  2. Use -b:v instead of -b since -b alone is ambiguous and could refer to both video and audio.
  3. Copy the audio stream with -c:a copy.

In essence:

avconv -i file.mpg -b:v 8M -maxrate 8M -minrate 8M -bufsize 4M -c:a copy -f mpegts file.ts

Upvotes: 3

Related Questions