You are not logged in.

#1 2021-02-14 10:45:51

Registered: 2018-05-06
Posts: 1

x264-cli encoding produces broken/noisy video


can someone confirm this failure?

Download a sample Video (for example Big Buck Bunny)

x264 --input-res 1920x1080 --crf 20 --frames 1500 -o /tmp/test.264 <sample_video>

(input-res may differ by your video sample, encode 1500 frames, only need some frames)

Play with your favorite player, i use mplayer or ffplay.
When x264 is broken, you see a noisy Picture and no clear frame.

I tested with a fresh archlinux none Desktop Installation and with fresh XFCE Desktop, both failed.

For over one year i reported a similar error in Bugtracker, but they wont fix it...

For this I checked again the PKGBUILD and I find out, that x264-cli worked fine, when ffmpeg is installed before compilation.
I prefere to work with x264-cli and not with ffmpeg and libx264, because it's simpler.

So, if anyone can confirm this, i will open again a bug in bugtracker or reopen the old one...

Greetz and Thanx


#2 2021-02-14 11:25:07

Registered: 2014-05-14
Posts: 732

Re: x264-cli encoding produces broken/noisy video

You might produce an elementary steam with *.264 that most players probably cannot play correctly. Use a hexeditor or mediainfo to find out. A most compatible video file should be encapsulated in mp4 or mkv container.

Another possible bug could be your gfx card/driver having problems with h/w acceleration. Turn it off for testing.

I do not use x264 directly (and i'm not in range of a capable system atm) so this is just a guess.

Last edited by Maniaxx (2021-02-14 11:28:45)



#3 2021-02-16 21:03:40

Registered: 2008-01-02
Posts: 193

Re: x264-cli encoding produces broken/noisy video

According to "x264 --help":

Infile can be raw (in which case resolution is required),
  or YUV4MPEG (*.y4m),
  or Avisynth if compiled with support (no).
  or libav* formats if compiled with lavf support (no) or ffms support (no).

As shown above using the vanilla x264 package from the Arch repo you either have to provide raw video or a .y4m file. If you want to convert arbitrary files you need to compile x264 with libavformat (lavf) or ffmpegsource (ffms) support. But you might as well just use ffmpeg instead.

It's possible that using "--input-res" makes x264 assume that the input is raw video, but in your case the input is not raw video, so the output looks like noise. I don't consider this behavior a bug. It's just doing what you told it to do.

So to summarize either:

  • Provide an actual raw video as input

  • Or provide y4m input (and omit "--input-res")

  • Or compile x264 to support lavf/ffms (and omit "--input-res")

  • Or just use ffmpeg


#4 2022-06-18 06:12:21

Registered: 2022-06-18
Posts: 1

Re: x264-cli encoding produces broken/noisy video

I can do it. First i got x264 with ffms support and lavf support and second I use - -fps option of x264.


Board footer

Powered by FluxBB