Announcement

Collapse
No announcement yet.

quality settings for ogg video

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    quality settings for ogg video

    hello,

    I'm trying to convert an avi raw video file to ogg with avconv.
    The quality was very poor, so I tried different paramenters like q:v or setting another bitrate.
    Unfortunately, there are still colors missing in black parts of my video and I couldn't really see any changes in the video when changing the options values.

    Obviously I don't really understand all the options.... what are the options I have to use, if the size of the video does not matter so much, but quality does?

    Thanks and regards

    Adriana

    #2
    The Quick

    Have you tried with the option ’-qscale n’ ?


    A bit more

    Avconv: http://libav.org/avconv.html -> http://libav.org/avconv.html#Tips
    ...
    To have a constant quality (but a variable bitrate), use the option ’-qscale n’ when ’n’ is between 1 (excellent quality) and 31 (worst quality).
    ...
    This is for the FFmpeg but both ffmpeg/libav have the same (or same kind of) options: http://www.kilobitspersecond.com/200...ty-comparison/

    ...Wanting to find a balance between picture quality and streamability, I began encoding a short length of AVI video at different compression levels. FFmpeg calls this “qscale” (a way of representing variable bitrate qualities, much like LAME’s –V parameter), and the lower the qscale value, the bet*ter the quality. The available qscale values range from 1 (highest quality) to 31 (lowest quality). Going worse than a 13 qscale produces unacceptably poor quality, so that’s as low as I went for the purposes of this test...

    Both the avi and the ogg are container formats...

    - http://en.wikipedia.org/wiki/Audio_Video_Interleave
    - http://en.wikipedia.org/wiki/Ogg
    A good place to start: Topic: Top 20 Kubuntu FAQs & Answers
    Searching FAQ's: Google Search 'FAQ from Kubuntuforums'

    Comment


      #3
      Thank you very much. I tried qscale, but this did not change so much. (and I don't understand why the files with qscale 2 are smaller than qscale 31, which should be poorer quality..?)

      Maybe its because there is a pixel format problem between my avi an the theora codec?
      I get the message '
      Incompatible pixel format 'bgr24' for codec 'libtheora', auto-selecting format 'yuv420p' ( whole output below)


      Code:
      ...:~/Desktop/test$ avconv -i original.avi -qscale 2  output.ogg
      avconv version 0.8.10-6:0.8.10-0ubuntu0.13.10.1, Copyright (c) 2000-2013 the Libav developers
        built on Feb  6 2014 20:53:28 with gcc 4.8.1
      [avi @ 0x1c2f580] non-interleaved AVI
      Input #0, avi, from 'original.avi':
        Duration: 00:00:30.62, start: 0.000000, bitrate: 298613 kb/s
          Stream #0.0: Video: rawvideo, bgr24, 960x540, 24 tbr, 24 tbn, 24 tbc
      File 'output.ogg' already exists. Overwrite ? [y/N] y
      Incompatible pixel format 'bgr24' for codec 'libtheora', auto-selecting format 'yuv420p'
      [buffer @ 0x1c37740] w:960 h:540 pixfmt:bgr24
      [avsink @ 0x1c37a40] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
      [scale @ 0x1c30360] w:960 h:540 fmt:bgr24 -> w:960 h:540 fmt:yuv420p flags:0x4
      Output #0, ogg, to 'output.ogg':
        Metadata:
          encoder         : Lavf53.21.1
          Stream #0.0: Video: libtheora, yuv420p, 960x540, q=2-31, 200 kb/s, 24 tbn, 24 tbc
      Stream mapping:
        Stream #0:0 -> #0:0 (rawvideo -> libtheora)
      Press ctrl-c to stop encoding
      frame=  735 fps= 43 q=0.0 Lsize=     224kB time=30.54 bitrate=  60.1kbits/s    
      video:214kB audio:0kB global headers:3kB muxing overhead 3.032465%

      Comment


        #4
        Maybe with: http://trac.ffmpeg.org/wiki/TheoraVorbisEncodingGuide

        Again, it is for the ffmpeg but seems to work with the libav (avconv).


        Test object: http://media.xiph.org/video/derf/ akiyo, QCIF (11 MB)


        With the libtheora & video -qscale

        Code:
        $ avconv -i akiyo_qcif.avi -codec:v libtheora -qscale:v 1 output-01.ogv        
        avconv version 9.11-6:9.11-2ubuntu2, Copyright (c) 2000-2013 the Libav developers
          built on Mar 24 2014 06:12:33 with gcc 4.8 (Ubuntu 4.8.2-17ubuntu1)
        [yuv4mpegpipe @ 0x1dde860] Estimating duration from bitrate, this may be inaccurate
        Input #0, yuv4mpegpipe, from 'akiyo_qcif.avi':
          Duration: N/A, bitrate: N/A
            Stream #0.0: Video: rawvideo, yuv420p, 176x144, PAR 128:117 DAR 1408:1053, 29.97 fps, 29.97 tbr, 29.97 tbn
        Output #0, ogg, to 'output-01.ogv':
          Metadata:
            encoder         : Lavf54.20.3
            Stream #0.0: Video: libtheora, yuv420p, 176x144 [PAR 128:117 DAR 1408:1053], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
        Stream mapping:
          Stream #0:0 -> #0:0 (rawvideo -> libtheora)
        Press ctrl-c to stop encoding
        frame=  300 fps=  0 q=0.0 Lsize=      30kB time=10.01 bitrate=  24.6kbits/s    
        video:26kB audio:0kB global headers:3kB muxing overhead 1.596905%
        With the libtheora & video bit rate:

        Code:
        $ avconv -i akiyo_qcif.avi -codec:v libtheora -b:v 10k output-10k.ogv
        avconv version 9.11-6:9.11-2ubuntu2, Copyright (c) 2000-2013 the Libav developers
          built on Mar 24 2014 06:12:33 with gcc 4.8 (Ubuntu 4.8.2-17ubuntu1)
        [yuv4mpegpipe @ 0x1394a20] Estimating duration from bitrate, this may be inaccurate
        Input #0, yuv4mpegpipe, from 'akiyo_qcif.avi':
          Duration: N/A, bitrate: N/A
            Stream #0.0: Video: rawvideo, yuv420p, 176x144, PAR 128:117 DAR 1408:1053, 29.97 fps, 29.97 tbr, 29.97 tbn
        Output #0, ogg, to 'output-10k.ogv':
          Metadata:
            encoder         : Lavf54.20.3
            Stream #0.0: Video: libtheora, yuv420p, 176x144 [PAR 128:117 DAR 1408:1053], q=2-31, 10 kb/s, 29.97 tbn, 29.97 tbc
        Stream mapping:
          Stream #0:0 -> #0:0 (rawvideo -> libtheora)
        Press ctrl-c to stop encoding
        frame=  300 fps=  0 q=0.0 Lsize=      18kB time=10.01 bitrate=  15.0kbits/s    
        video:15kB audio:0kB global headers:3kB muxing overhead 2.496049%
        A good place to start: Topic: Top 20 Kubuntu FAQs & Answers
        Searching FAQ's: Google Search 'FAQ from Kubuntuforums'

        Comment


          #5
          Thank you very much. I tried the best bitrate and qscale settings...but I don't get some of the colours from the original file.
          Could the pixel format be a reason for this?
          below what a screenshot from the avi-film. in no ogg version I got this light areas...they always disappear in complete black

          Comment


            #6
            Could the pixel format be a reason for this?
            It could be, http://wiki.multimedia.cx/index.php?title=PIX_FMT_BGR24 . I tried to convert a sample with the '-pix_fmt bgr24' to the bgr24 pixel format and then to the ogv. There is the warning: 'Incompatible pixel format 'bgr24' for codec 'libtheora', auto-selecting format 'yuv420p'. The conversion from the 'bgr24' to the ogv was succesful.

            Something to try:

            - convert your original to the lossless codec /1/ and then ogv

            With Huffyuv /2/:

            Code:
            avconv -i original.avi -codec:v huffyuv huffyuv.avi
            avconv -i huffyuv.avi -codec:v libtheora -qscale:v 10 huffyuv-to-ogv.ogv



            Is there a reason for the lossy Theora codec ? Maybe a lossless codec would work better ?




            Links

            1. http://en.wikipedia.org/wiki/Comparison_of_video_codecs
            2. http://en.wikipedia.org/wiki/Huffyuv
            Last edited by Rog132; Apr 15, 2014, 09:28 AM.
            A good place to start: Topic: Top 20 Kubuntu FAQs & Answers
            Searching FAQ's: Google Search 'FAQ from Kubuntuforums'

            Comment


              #7
              I have never had satisfactory results using OGV containers with Theora video. This is surprising, since they're supposed to "go together." MKV works much better.

              For example, run the following:
              Code:
              avconv -f x11grab -s $(xdpyinfo | awk '/dimensions/ {print $2}') -i :0.0 -c:v libtheora -q:v 10 test.ogv
              Then switch to an open window and scroll around, maybe bounce between some tabs and scroll some more. Next return to the console and press Ctrl+C. Now watch the video. It's very jerky -- as if most frames were simply dropped.

              Now run the following:
              Code:
              avconv -f x11grab -s $(xdpyinfo | awk '/dimensions/ {print $2}') -i :0.0 -c:v libtheora -q:v 10 test.mkv
              Repeat the test of switching and scrolling windows. Then watch the recorded video. Everything's fine. I am flummoxed as to why OGV has problems with its own preferred video format.

              Comment

              Working...
              X