8

I have this linux command line app called avcon. It is used to converting files. For instance if I have a file called video.mp4 I can run avconv -i video.mp4 video.ogg and it will convert this video.mp4 to video.ogg.

So my problem(question): Whenever it converts any file the output file's quality is super bad compared to the original video (the input video). How can I get around with that? I mean how can I convert the file and still get the same quality?

If this is not possible using this app. Can anybody suggest anything else for converting video files using the command line?

2 Answers 2

7

You can adjust the video quality using the -qscale flag for that command. Using -qscale 1 should provide the best quality and if you do not use this flag, the result is usually terrible quality. Try using this instead:

avconv -i video.mp4 -threads auto -qscale 1 -aq 1 video.ogg

I've also included a flag to optimize use of multiple threads and another to maximize audio quality.

17
  • What are these extra flags doing? Like: threads, aq ?
    – Anonymous
    Jul 23, 2015 at 5:32
  • @Anonymous -aq is audio quality. Use 1 for the best audio quality. If it takes a really long time to convert the file, you could probably do it faster without the aq flag but audio may not be the best quality in the end. Next, a thread is a task run by a processor. If you have 2 physical cores using -threads 2 should optimum performance. However, if you want to limit system resources consumed by the process, you could limit it to one thread to use only one core to run the process but it will take longer. Setting it to auto is supposed to automatically choose the best option for you.
    – mchid
    Jul 23, 2015 at 5:53
  • I ran this command but now there is no audio? Can you tell me what's wrong?
    – Anonymous
    Jul 23, 2015 at 6:35
  • Ok! The audio is there but firefox is not playing the audio. Any help?
    – Anonymous
    Jul 23, 2015 at 6:42
  • Hey @mchid I found this superuser.com/questions/353022/no-sound-in-html5-video . Can you please explain to me what is audio codec, libtheora etc. Please help me dude, I don't know shit about videos. But I need to convert it in my web app to produce cross browser html5 video.
    – Anonymous
    Jul 23, 2015 at 6:46
0

avconv -i video.mp4 -threads auto -qscale 10 -aq 10 video.ogg

10 is the highest quality.

Ref: https://trac.ffmpeg.org/wiki/TheoraVorbisEncodingGuide Yes reference is for ffmpeg but I guess avconv and ffmpeg have a compatible interface.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .