Page 202 of 241 FirstFirst ... 102152192200201202203204212 ... LastLast
Results 2,011 to 2,020 of 2402

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

  1. #2011
    Join Date
    Dec 2005
    Location
    St. Petersburg, FL
    Beans
    550
    Distro
    Ubuntu 17.04 Zesty Zapus

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

    AviSynth doesn't compress anything. Basically, the script is a list of changes intended for the file you are opening, and then any program you give the script to sees all of those changes having already been made. I've heard of 'output' plugins that will write to new video or audio files, but I've never messed with them myself. I really just don't see the point.

    The functions AviSynth has access to may not be faster, but there's a whole lot more of them to choose from, and some of those choices are better quality/more accurate.

    A script named input.avs:
    Code:
    FFVideoSource("filename.mp4")
    The compression step (on Windows):
    Code:
    x264.exe --preset veryslow --crf 18 -o output-test.mkv input.avs
    The compression step (on Linux):
    Code:
    wine avs2yuv input.avs - | x264 --stdin y4m --preset veryslow --crf 18 -o output-test.mkv -
    Last edited by qyot27; December 8th, 2011 at 05:53 PM.

  2. #2012
    Join Date
    Oct 2007
    Beans
    16
    Distro
    Ubuntu 9.10 Karmic Koala

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

    Lots of great information and all in one place. I will definitely be bookmarking this.

  3. #2013
    Join Date
    Sep 2006
    Beans
    3,713

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

    Generate a life pattern based on a generalization of John Conway's life game:
    Code:
    ffplay -f lavfi life

  4. #2014
    Join Date
    Aug 2008
    Beans
    67

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

    Quote Originally Posted by qyot27 View Post

    A script named input.avs:
    Code:
    FFVideoSorce("filename.mp4")
    The compression step (on Windows):
    Code:
    x264.exe --preset veryslow --crf 18 -o output-test.mkv input.avs
    Ok, I've installed avisynth, then dowloaded x264.exe 32bit 10bit-depth(what is general difference with 32bit 8bit-depth?) from here, puted x264.exe in C:\Program Files\AviSynth 2.5\plugins, and also downloaded FFmpegSource 2.16 from here, and puted files FFMS2.avsi ffms2.dll ffmsindex.exe in C:\Program Files\AviSynth 2.5\plugins. Then copied in C:\Program Files\AviSynth 2.5\plugins test videofile 1.mp4. I created input.avs file(and puted it in the same folder) with this content:

    FFVideoSource("1.mp4")
    I cutted mp4 file(just extracted small peace for recode testing)
    Then I entered in C:\Program Files\AviSynth 2.5\plugins folder and run a command:

    x264.exe --preset slow --crf 18 -o output-test.mp4 input.avs
    That gave an output mp4 file smaller in about two times, but with no sound(guess I should extract the audio before and compress it separately because avisynth doesn't support it?). But the video is very bad(small colored squares), so I think I have to use another preset. Maybe I have to use FFmpegSource 2.16 AVS cplugin instead of FFmpegSource 2.16?

    ... wait a minute, mplayer under linux(without gui) is able to play normally that output file(but again with no audio) which played with squares on windows, but totem and vlc uder linux doesn't play it.
    Here is mediainfo information about this output file:
    General
    Complete name : output-test.mp4
    Format : MPEG-4
    Format profile : JVT
    Codec ID : avc1
    File size : 26.2 MiB
    Duration : 30mn 0s
    Overall bit rate : 122 Kbps
    Encoded date : UTC 2011-12-09 15:40:38
    Tagged date : UTC 2011-12-09 15:40:38

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High 10@L3.1
    Format settings, CABAC : Yes
    Format settings, ReFrames : 5 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 30mn 0s
    Bit rate : 121 Kbps
    Maximum bit rate : 1 833 Kbps
    Width : 800 pixels
    Height : 598 pixels
    Display aspect ratio : 4:3
    Frame rate mode : Constant
    Frame rate : 15.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 10 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.017
    Stream size : 26.0 MiB (99%)
    Writing library : x264 core 120 r2120 0c7dab9
    Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=15 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=81 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Encoded date : UTC 2011-12-09 15:40:38
    Tagged date

    I wonder what is the best way to do the compession with ffmpeg? Mediainfo of input 1.mp4 test file is:

    General
    Complete name : 1.mp4
    Format : MPEG-4
    Format profile : Base Media
    Codec ID : isom
    File size : 42.5 MiB
    Duration : 30mn 0s
    Overall bit rate : 198 Kbps
    Encoded date : UTC 2011-12-08 15:25:12
    Tagged date : UTC 2011-12-08 15:25:12

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L3.1
    Format settings, CABAC : Yes
    Format settings, ReFrames : 4 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 30mn 0s
    Bit rate : 143 Kbps
    Width : 800 pixels
    Height : 598 pixels
    Display aspect ratio : 4:3
    Frame rate mode : Constant
    Frame rate : 15.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.020
    Stream size : 30.6 MiB (72%)
    Language : English
    Encoded date : UTC 2011-12-07 08:18:34
    Tagged date : UTC 2011-12-08 15:25:14
    Color primaries : BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177
    Transfer characteristics : BT.709-5, BT.1361
    Matrix coefficients : BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177

    Audio
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format profile : LC
    Codec ID : 40
    Duration : 30mn 0s
    Bit rate mode : Constant
    Bit rate : 53.6 Kbps
    Nominal bit rate : 48.0 Kbps
    Channel(s) : 2 channels
    Channel positions : Front: L R
    Sampling rate : 44.1 KHz
    Compression mode : Lossy
    Stream size : 11.5 MiB (27%)
    Language : English
    Encoded date : UTC 2011-12-07 08:18:34
    Tagged date : UTC 2011-12-08 15:25:14
    Last edited by rulet; December 10th, 2011 at 12:08 AM.

  5. #2015
    Join Date
    Mar 2007
    Location
    Outer Milky Way
    Beans
    Hidden!
    Distro
    Kubuntu 12.04 Precise Pangolin

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

    First of all, mencoder is better than ffmpeg.

    Secondly, I did all the instructions in this thread only to find that everything I wanted to do (including a reasonably current version of x264) was already included in the repository packaging of FFMPEG from Lucid onwards.

    I wasted a lot of time reading this thread; it is only for cutting edge changes and for the average user is no longer necessary at all.

    UbuntuGuide/KubuntuGuide

    Right now the killer is being surrounded by a web of deduction, forensic science,
    and the latest in technology such as two-way radios and e-mail.

  6. #2016
    Join Date
    Sep 2006
    Beans
    3,713

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

    Quote Originally Posted by perspectoff View Post
    First of all, mencoder is better than ffmpeg.
    Please elaborate how MEncoder, which is barely maintained, is better than FFmpeg. In what ways is it better?

    Quote Originally Posted by perspectoff View Post
    Secondly, I did all the instructions in this thread only to find that everything I wanted to do (including a reasonably current version of x264) was already included in the repository packaging of FFMPEG from Lucid onwards.
    The Ubuntu maintainer for FFmpeg and x264 is doing a better job at keeping the repository packages relatively recent (although Ubuntu doesn't actually provide FFmpeg packages anymore). This was not always the case and was a major reason for the creation of this guide. Of course the repository packages are inflexible and can not provide the features and additions that a user may acquire from compiling. However, this guide can not predict what all users will want and it's the user's responsibility to first see if the packages from the repository will meet their needs.

    Quote Originally Posted by perspectoff View Post
    I wasted a lot of time reading this thread;
    I hope you didn't read the whole thread. It's long.

    Quote Originally Posted by perspectoff View Post
    ...it is only for cutting edge changes and for the average user is no longer necessary at all.
    Of course I will disagree with this, and you may be underestimating the average Linux user.

  7. #2017
    Join Date
    Dec 2005
    Location
    St. Petersburg, FL
    Beans
    550
    Distro
    Ubuntu 17.04 Zesty Zapus

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

    Quote Originally Posted by rulet View Post
    Ok, I've installed avisynth, then dowloaded x264.exe 32bit 10bit-depth(what is general difference with 32bit 8bit-depth?) from here, puted x264.exe in C:\Program Files\AviSynth 2.5\plugins, and also downloaded FFmpegSource 2.16 from here, and puted files FFMS2.avsi ffms2.dll ffmsindex.exe in C:\Program Files\AviSynth 2.5\plugins. Then copied in C:\Program Files\AviSynth 2.5\plugins test videofile 1.mp4. I created input.avs file(and puted it in the same folder) with this content
    x264.exe can be put in C:\WINDOWS (ffmsindex.exe could be put there as well, unless you want to go and modify the Path environment variable). Having x264 in C:\WINDOWS will allow you to use it from any place in the file system, and the video and script files need not be in the same folder as the program. Nor do the video file and script have to be in AviSynth's plugins folder. Just the plugins need to be in that folder.

    The difference between 8-bit and 10-bit is the internal precision of the codec (more or less) and generally speaking, the higher the bit depth, the less of a problem with banding you'll have and you'll also feasibly get better compression for the same level of quality. 10-bit support is rather new (relatively speaking; encoding it with x264 has been possible since July of 2010, but solid decoding support came a few months later and some users are still using decoders from a couple years ago, which are too old to support it), and some of the problems on playback you describe below may simply be the result of not having properly updated decoding software on Windows.

    That gave an output mp4 file smaller in about two times, but with no sound(guess I should extract the audio before and compress it separately because avisynth doesn't support it?). But the video is very bad(small colored squares), so I think I have to use another preset. Maybe I have to use FFmpegSource 2.16 AVS cplugin instead of FFmpegSource 2.16?
    There's no super-huge difference between FFMS2's trunk and C plugin branches (that is, if one doesn't consider the compiler to be a huge difference). The biggest difference is the need to use LoadCPlugin() at the beginning of your script* to load the C plugin, as C plugins don't autoload. The C plugin also has a couple of observable quirks under special circumstances, but these aren't exactly common.

    *inserting the LoadCPlugin call into FFMS2.avsi before the function starts works too.

    The lack of audio is because you didn't tell FFMS2 to load audio (if you want audio with FFMS2, use FFmpegSource2 and the atrack= parameter). Also, unless you get audio-supporting builds of x264, then no, x264 doesn't support audio. If you see that the build supports L-SMASH (which is an alternative MP4 muxer), then it's almost certain to support audio.

    ... wait a minute, mplayer under linux(without gui) is able to play normally that output file(but again with no audio) which played with squares on windows, but totem and vlc uder linux doesn't play it.
    Likely just an issue of the restricted-extras package not being installed? Or like I said before, you might need to make sure the versions of the software are new enough to support 10-bit H.264.

  8. #2018
    Join Date
    Aug 2008
    Beans
    67

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

    Quote Originally Posted by qyot27 View Post
    Likely just an issue of the restricted-extras package not being installed? Or like I said before, you might need to make sure the versions of the software are new enough to support 10-bit H.264.
    No, everything is installed, and new versions, this issue concerning just this output mp4 file.

  9. #2019
    Join Date
    Dec 2005
    Location
    St. Petersburg, FL
    Beans
    550
    Distro
    Ubuntu 17.04 Zesty Zapus

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

    Then, based on the mediainfo output, try to make sure the height and width are multiples of 16 (actually, I think H.264 can use multiples of 4 or 8, but 16 makes that completely safe). 800 is fine (if nonstandard), but 598 is not; it's not even a multiple of 4. I wouldn't be at all surprised if that's responsible for at least some issue.

    800x600 would probably be fine.

  10. #2020
    Join Date
    Aug 2008
    Beans
    67

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

    So, do I have to rescale it with avisynth adding some parameters in input.avs file?

Page 202 of 241 FirstFirst ... 102152192200201202203204212 ... 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
  •