Page 9 of 240 FirstFirst ... 78910111959109 ... LastLast
Results 81 to 90 of 2393

Thread: HOWTO: Install and use the latest FFmpeg and x264

  1. #81
    Join Date
    Aug 2008
    Beans
    5

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    What command would output the highest quality x264/aac mp4 possible in a single pass encode? file size isnt too a big issue to me, but if you could explain what each variable did would be nice also

  2. #82
    Join Date
    Sep 2006
    Beans
    3,707

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    I have little experience with one-pass x264 encoding, but you have two major choices to make. You can either encode using Constant Rate Factor (CRF) or by bitrate. Here's two examples that are what I think would be good for one-pass, but I didn't test them.

    CRF:
    Code:
    ffmpeg -i input -crf 16 -threads 0 -vcodec libx264 -refs 6 -subq 6 -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -flags2 +brdo+dct8x8+wpred+bpyramid+mixed_refs -me_method umh -trellis 1 -bf 16 -directpred 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -vframes 200 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 output.mp4
    Using the above code will make a high-quality encode but it will also be very slow.

    Bitrate:
    Code:
    ffmpeg -i input -threads 0 -b 800k -bt 800k -vcodec libx264 -refs 6 -subq 6 -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -flags2 +brdo+dct8x8+wpred+bpyramid+mixed_refs -me_method umh -trellis 1 -bf 16 -directpred 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -vframes 200 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 ouput.mp4
    Most important settings to mess with are crf, b, bt, refs, and subq. If you want to learn what each parameter does:
    FFmpeg x264 encoding guide (more and probably better examples)
    FFmpeg x264 mapping
    x264 Settings
    Encoding with the x264 codec (for mencoder, but still useful)

  3. #83
    Join Date
    Aug 2008
    Beans
    5

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    what do u recommend, crf or bitrate?
    and what is the point of 2 pass encoding?
    i mean cant everthing be done in 1 pass? lol srry im new to this.

    thanks

  4. #84
    Join Date
    Sep 2006
    Beans
    3,707

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by jiexi View Post
    what do u recommend, crf or bitrate?
    I would experiment with both and see which is faster and/or better quality. You can add "-vframes 300" to encode just 300 frames (or whatever number you want) to test. You can also add "-psnr" which will output the Peak Signal to Noise Ratio. Higher is better: look at the "global" value. You can time the encode by using the time command like "time ffmpeg".
    Quote Originally Posted by jiexi View Post
    and what is the point of 2 pass encoding?
    "Encoding with the x264 codec" linked in my previous post will explain this better than me.

  5. #85
    Join Date
    Aug 2008
    Beans
    2

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by mocha View Post
    Can someone give me a hand? Please do a fresh pull of x264 and ffmpeg, then try to encode any video with ffmpeg using libx264 and verify that you get a segmentation fault. It seems there is a new bug either in ffmpeg or x264. If you search google, there is 1 or 2 threads about this on the ffmpeg mailing list from August 2008. In one of the messages the ffmpeg dev says it 'probably' has something to do with x264.

    Can someone also tell me the last SVN of ffmpeg that they successfully got working with x264? I temporairily went back to 13060 which was the last version I was using prior to rebuilding x264 and ffmpeg last night, but I'm sure there's probably a later version that will still work. Thanks.
    I have the latest version of everything and I can verify the segmentation fault takes place with
    Code:
    -vcodec libx264

  6. #86
    Join Date
    Aug 2008
    Beans
    2

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by mocha View Post
    Can someone give me a hand? Please do a fresh pull of x264 and ffmpeg, then try to encode any video with ffmpeg using libx264 and verify that you get a segmentation fault. It seems there is a new bug either in ffmpeg or x264. If you search google, there is 1 or 2 threads about this on the ffmpeg mailing list from August 2008. In one of the messages the ffmpeg dev says it 'probably' has something to do with x264.

    Can someone also tell me the last SVN of ffmpeg that they successfully got working with x264? I temporairily went back to 13060 which was the last version I was using prior to rebuilding x264 and ffmpeg last night, but I'm sure there's probably a later version that will still work. Thanks.
    Does 13060 work with -vcodec libx264 ?

  7. #87
    Join Date
    Aug 2008
    Beans
    5

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    since 2 pass gives higher quality even tho it takes more time
    i think i figured out how to include a 2 pass with the video sharing script i am using. so if you would be so kind, please give me a 2 pass code for the crf way u showed in ur great example.
    btw, for some reason i cant seek in the 8 second videos that are created with both the bitrate and crf examples u gave. nor does qt-faststart work with them. well it seems to me as if that is the issue, or maybe its because the files are only 8 seconds.

    Thanks again!

    EDIT: nvm, ur examples dont mess with qtfaststart.
    Last edited by jiexi; August 25th, 2008 at 06:13 AM.

  8. #88
    Join Date
    Sep 2006
    Beans
    3,707

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by jiexi View Post
    please give me a 2 pass code for the crf way u showed in ur great example.
    I dont think CRF is used for two-pass very often. There is a good two-pass example at FFmpeg x264 encoding guide.
    Quote Originally Posted by jiexi View Post
    btw, for some reason i cant seek in the 8 second videos that are created with both the bitrate and crf examples u gave.
    I believe seeking is related to the keyframe interval or length of the Group of Pictures (GOP), which in your case was "-g 250" frames, or 8.3 seconds which is larger than your whole video.

  9. #89
    Join Date
    Aug 2008
    Beans
    5

    Wink Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Quote Originally Posted by FakeOutdoorsman View Post
    I dont think CRF is used for two-pass very often. There is a good two-pass example at FFmpeg x264 encoding guide.

    I believe seeking is related to the keyframe interval or length of the Group of Pictures (GOP), which in your case was "-g 250" frames, or 8.3 seconds which is larger than your whole video.
    Thanks for your help!

  10. #90
    Join Date
    Aug 2008
    Beans
    3

    Re: HOWTO: Compile the latest ffmpeg and x264 from source

    Stuck on trying to code an mpg to mpg4 using the ffmpeg and x264, this is what I am getting.....

    ouicho@Atalanta:~$ ffmpeg -i /home/ouicho/Desktop/56-form-chensi.mpg -crf 16 -threads 0 -vcodec libx264 -refs 6 -subq 6 -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -flags2 +brdo+dct8x8+wpred+bpyramid+mixed_refs -me_method umh -trellis 1 -bf 16 -directpred 3 -b_strategy 1 -bidir_refine 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -vframes 200 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 output.mp4

    FFmpeg version SVN-r14974, Copyright (c) 2000-2008 Fabrice Bellard, et al.
    configuration: --enable-nonfree
    libavutil 49.10. 0 / 49.10. 0
    libavcodec 51.69. 0 / 51.69. 0
    libavformat 52.21. 0 / 52.21. 0
    libavdevice 52. 1. 0 / 52. 1. 0
    built on Aug 26 2008 18:18:19, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
    Input #0, mpeg, from '/home/ouicho/Desktop/56-form-chensi.mpg':
    Duration: 00:05:40.96, start: 0.213333, bitrate: 614 kb/s
    Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 104857 kb/s, 30.00 tb(r)
    Stream #0.1[0x1c0]: Audio: mp2, 32000 Hz, mono, s16, 32 kb/s
    Warning: not compiled with thread support, using thread emulation
    Unknown encoder 'libx264'

Page 9 of 240 FirstFirst ... 78910111959109 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •