Forum Replies Created

Page 3 of 24
  • Michael Rampe

    February 2, 2012 at 9:28 pm in reply to: Improve filesize with same quality?

    and also for reference….

    “The decoder’s buffer is filled over time at a constant data rate in the case of CBR, and at a non-constant rate in the case of VBR. In both cases, data is removed from the buffer in varying chunks, depending on the actual size of the coded frames.
    In the H.264 and VC-1 standards, the VBV is replaced with generalized version called Hypothetical Reference Decoder (HRD).”
    https://en.wikipedia.org/wiki/Video_buffering_verifier

    And a post from Dark Shikari on the FFmpeg boards (x264 creator) states:
    “CBR is when maxrate == bitrate and bufsize is set.”

    Michael

  • Michael Rampe

    February 2, 2012 at 9:14 pm in reply to: Streaks in Movie

    Good to see a resolution.

    Lesson for all of us: png is good for some things but not for all;-)

    Michael

  • Michael Rampe

    February 2, 2012 at 9:12 pm in reply to: fixing audio in MPEG 2 multiplexed file

    [William Thomas] “This needs to be rendered or transcoded or saved to a .mpg extention to be able to work in a legal software.”

    The syntax is:

    $ ffmpeg -i input.m2v -i input.aif [codec options] output.mpg

    This will only work if the video has no audio. Otherwise you will need the map command to set the streams.

    Michael

  • Michael Rampe

    February 2, 2012 at 9:06 pm in reply to: Improve filesize with same quality?

    [Jake Patzke] “I have heard that since Youtube itself uses constant bitrates (480p, 720p, etc), the CRF method is preferable to VBR two-pass encoding for videos that will be uploaded to that site. Is this true?”

    The file produced by two pass target bitrate and one pass CRF are very similar in terms of bitrate distribution.

    “Constant bitrate” is a very misunderstood term in regards to interframe compression (rather than intraframe compression). It refers to the rate the video buffer is filled, not necessarily how many bits per second are transferred. Constant bitrate is really only needed (or desired as there are more artifacts) when you are dealing with limitations of some hardware deocoder chips. The nature of I,P,B H.264 in general is variable bitrate.

    [Jake Patzke] “Also, if I want my script to process different-resolution video equally well, will a given CRF setting produce similar qualities for 720p and 1080p video, or will one be better?”

    Similar qualities. You are basically setting the quantiser level so the 1080p file will be bigger than the 720p file but at a similar quality level.

    Anyway, seeing that youtube will reprocess your files anyway, the best option is to give them the highest “constant quality” rather than a constant bitrate (whether or not they use constant bitrate which I am pretty sure they don’t anyway).

    Michael

  • Michael Rampe

    February 1, 2012 at 10:30 pm in reply to: Streaks in Movie

    [Adam Theisen]
    I did remove it and tried it, but I was still seeing streaks, even in the original .mov file.”

    OK. This helps narrow down the problem to your intermediate.

    As you are not specifying a codec here, FFmpeg uses a default for the container which is most likely mpeg4 (divx variety not x264 variety).

    I use .mpg with -sameq for my intermediates which does result in near lossless large files.

    All you would need to do is change .mov to .mpg in your example and FFmpeg will get the codec right.

    eg.
    $ ffmpeg -f image2 -i image_%2d.png -y -r 20 -sameq movie.mpg

    If the streaks are still there after that, there is another upstream issue but we are getting closer;-)

    Michael

  • Michael Rampe

    February 1, 2012 at 9:26 pm in reply to: Streaks in Movie

    ahhhh, ok.

    [Adam Theisen] “ffmpeg -f image2 -bufsize 12000.0k -i image_%2d.png -y -r 20 -sameq movie.mov”

    Why are you setting bufsize on the input? Firstly, try to remove this.

    [Adam Theisen] “ffmpeg -f mov -i movie.mov -vcodec libx264 -fpre /apps/base/share/ffmpeg/libx264-normal.ffpreset -bufsize 12000.0k -b 3000k -minrate 500 -y movie.mp4”

    Again, not sure why you are setting bufsize here either? The streaks you are getting could very easily be caused by buffer overflows.

    Also, from this command line, I can determine that it may be time to upgrade to a more recent version. -fpre for libx264 is now deprecated and -preset is used to directly access x264 presets. I am running a very recent version which comes with NO x264 preset files in the ffprests folder (only vpx presets)

    Michael

  • Michael Rampe

    February 1, 2012 at 9:17 pm in reply to: Improve filesize with same quality?

    [Jake Patzke] “I was wondering if I could trade some more encoding time to get a similar-quality file but with a smaller filesize. In particular, I’ve heard that two-pass encoding can do this, but the demonstrations I found were difficult to wrap my head around.”

    Tricky question but the answer is “yes” with a but.

    Two pass encoding is used to ensure that the quality of the final video is consistent across the range of frames. It does this by analysing the video in the first pass to determine a “best fit” quantiser level that will hit the target bitrate (ie -b). Without a target bitrate (and when target bitrate is not of concern) it has no real benefits.

    The other option is to use a different rate control method.
    -crf (constant rate factor). Start with a setting of 1 and incrementally increase the number until you get an acceptable quality/filesize ratio. This is very similar to a two pass encode except that you determine the quantiser rather than FFmpeg. It can also be controlled with other methods such as -qmin and -qmax etc.

    eg:
    $ ffmpeg -i input.mov -c:v libx264 -crf 10 output.mp4

    Michael

  • Michael Rampe

    February 1, 2012 at 9:00 pm in reply to: Streaks in Movie

    …and a sample of your FFmpeg command line? (codec, bitrate etc.)

  • Michael Rampe

    January 31, 2012 at 8:59 pm in reply to: Streaks in Movie

    [Adam Theisen] “I was able to get it to work, but only for the grayscale colorspace. The other spaces are still leaving me with streaks in the final movie and an empty color table when I read it in.”

    Can you post some of these images so I can try to replicate? I am intrigued now;-)

    Michael

  • Michael Rampe

    January 30, 2012 at 10:58 pm in reply to: Streaks in Movie

    [Adam Theisen] “The latest I have found out is after I use the convert command, the color table from the metadata is not available.”

    I have had issues with this in the past….

    I fixed it by running another convert command to set the colorspace.

    Example:
    $ convert input.png -type TrueColorMatte output.png

    Give it a go and try a few different colorspaces to see if this helps.

    Michael

Page 3 of 24

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy