Announcement

Collapse
No announcement yet.

Resizing a video *prior to* compression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cerebrus
    Geek in training
    • Oct 2009
    • 5

    Resizing a video *prior to* compression

    Hi all,

    This is my first post here although I've been lurking around similar forums for a while now. I'm not completely new to video encoding, having done a few encodes and I understand the basics. I have a lot of AVI movies that are usually around 2 CD's in size (1.4 GB, already XviD encoded) that I want to convert to single CD (~700 MB, AVI format), while maintaining a reasonable degree of quality. For this purpose, I use VirtualDUB with XviD compression. My modus operandi is to encode the video and audio separately and then Mux the output.

    During these encodes, sometimes the resultant video's average bitrate falls below 800 kbps from a source bitrate of about 1500 kbps (which is unacceptable). So, my idea was to reduce the dimensions of the video slightly (90%-95%) and then perform the compression. However, this does not seem to be so simple because VirtualDUB seems to apply the resize filters as a "post-processing" mechanism. The bitrate calculator in the XviD configuration dialogs does not seem to take into account the fact that the video dimensions have been reduced, so a higher bitrate would be feasible. It gives me an output video with almost the same bitrate irrespective of whether I apply a Resize filter or not.

    In order to work around this, I attempted to do it in two steps - Use VirtualDUB to "Direct stream copy" a resized video and then apply compression to this intermediate file. However, VirtualDUB does not allow me to apply filters in Direct stream copy mode.

    I also tried to encode a frame served video (using an AviSynth script to load a Lanczos resized video in VirtualDUB) and encoding it. However, the bitrate calculator and the actual encoding output results in a video with the same quality as earlier. I feel that I am missing something basic and my research has not revealed any clues. Am I even on the right track here and perhaps need to reduce dimensions still more? Would greatly appreciate any help in this matter.

    Please note that I do not wish to use H.264 compression because I want the movies to be playable on my standalone DVD player.
  • paglamon
    Lord of Digital Video
    Lord of Digital Video
    • Aug 2005
    • 2126

    #2
    It gives me an output video with almost the same bitrate irrespective of whether I apply a Resize filter or not
    Well,that is expected. Size of file= bitrate x time. Once you have specified the size of the file to be 700 MB(1 cd), the bitrate will be the same for a given length of the video. The RESIZE filter will not affect the bitrate, but it will have an effect on the quality of video at a given bitrate.Thus, at a lower bitrate,the video with a lower resolution might look a bit better than one with a higher resolution.
    sigpic

    ONLY MOMENTS LINGER...DEWDROPS ON A FALLEN LEAF

    Comment

    • Cerebrus
      Geek in training
      • Oct 2009
      • 5

      #3
      Paglamon, sorry for not replying earlier... was having internet connectivity issues.

      Thank you so much for clarifying the concept so succinctly. I understand now that the bitrate is a fixed parameter based on the running video length (once output size is fixed).

      How do the experts do it, then ? How do they create files with ~800-1000 kbps bitrate within a limited size of 700 MB even for videos that extend upto 2 hrs ? If you were given a video file around 1.4 GB in size and asked to convert it to 700 MB with best possible quality, how would you go about it (step by step)?

      Edit: You suggested that a lower resolution might look better even at lower bitrate. How is this done ? The only way I know of is to apply the post-process resizing filter in VirtualDUB. Is that the right way to achieve the effect ?

      Your response is greatly appreciated.
      Last edited by Cerebrus; 5 Oct 2009, 12:11 AM.

      Comment

      • UncasMS
        Super Moderator
        • Nov 2001
        • 9047

        #4
        as paglamon already mentioned: bitrate is a fixed number which refers to the number of frames / running time

        a certain bitrate, say 800kbps, will have to be distributed to ALL the pixels of a given frame

        this means that a frame by the size of 720x480 will have way more pixel than 576x384 but the frames of both sizes will get the same bitrate distribution

        therefor the saturation in the smaller frames will be higher and may look better in critical scenes/bitrates

        by the way: instead of doing the job manually (audio + video conversion + muxing) why not load your input material in tools like mediacoder or super and let them reduce frame and file size?

        +++++

        in vd mod you can access internal filter like a resizer this way:
        => video => filters => add => resize
        Last edited by UncasMS; 5 Oct 2009, 01:12 AM.

        Comment

        • Cerebrus
          Geek in training
          • Oct 2009
          • 5

          #5
          Thanks for that explanation, UncasMS! I think the problem was that I was incorrectly judging the quality of a video by its bitrate.

          I use GSpot to analyze all video files. Maybe I should be looking at the Qf instead (which indicates it is actually average "Frame Quality" - bits/pixel-frame) ? If not, what is the right way to accurately measure the relative quality of a video file ?

          Thanks for your patience, guys!

          Originally Posted by UncasMS
          by the way: instead of doing the job manually (audio + video conversion + muxing) why not load your input material in tools like mediacoder or super and let them reduce frame and file size?
          I prefer to do it manually because I'm a control freak! Additionally, I like to encode the beginning and end credits at a very low weight factor and in grayscale. I also like to encode my audio to mp3 ABR with specific downmixing options. But most of all, I learn a lot every time!

          Comment

          • UncasMS
            Super Moderator
            • Nov 2001
            • 9047

            #6
            i personally would NOT give toooo much on quality analysis because you already deal with compressed material and i feel tempted to say:
            garbage in, garbage out - or you cant turn **** into gold

            dont be offended, but you may already have pixelation and bad bitrate distribution and you cannot reverse artefacts and flaws

            as a sidenote because you mentioned not wanting h/x264:
            my blu-ray player now (after latest fw update) supports MKV playback from cd/dvd/usb

            you dont by chance plan to use a htpc or blu-ray player?
            they could provide new opportunities
            Last edited by UncasMS; 9 Oct 2009, 02:33 AM.

            Comment

            • MilesAhead
              Eclectician
              • Nov 2006
              • 2615

              #7
              Just for grins you could try AviDemux 2.4. You can use the slider to select an I frame after opening credits and before closing credits. In the xvid configuration choose 2 pass video size. The default is 700 MB. Then do your opening and closing credits with other settings. In the Audio menu you just save out the audio track if you wish to process it with a 3rd party program. When done you can mux them back with the same menu.

              I haven't experimented with changing sizes for the purpose you mention. But it sounds like if you really want to experiment the way to go would be AviSynth filters. Perhaps using some converter where the entire process is controlled by an AviSynth script that allows you to control which action happens in what order. If you google AviSynth Filters and Tutorial you should get a bunch of sites.

              I'm lazy so I learned just enough about AviSynth to edit scripts created by converters, but if you get into it you can do quite a bit of manipulation with free tools.

              Comment

              • Cerebrus
                Geek in training
                • Oct 2009
                • 5

                #8
                Thanks for that useful advice, guys. I'm really pleased to have joined this forum. You folks rock!

                I'll create a separate thread to continue the discussion on quality analysis since that question isn't really related to the Thread topic.

                Comment

                Working...
                😀
                🥰
                🤢
                😎
                😡
                👍
                👎