Michael Miller | 5 Mar 2010 21:47
Favicon

new to x264 and ffmpeg

I'm new to x264 and ffmpeg, so please direct me to an alternate support source if appropriate.

Today, I downloaded and tried to compile x264 for use with ffmpeg and got the following:

x264]$ ./configure --enable-shared 
x264]$ make

gcc -O3 -ffast-math  -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99  -I/usr/local/include   -s
-fomit-frame-pointer   -c -o input/thread.o input/thread.c
gcc -O3 -ffast-math  -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99  -I/usr/local/include   -s
-fomit-frame-pointer   -c -o input/lavf.o input/lavf.c
ar rc libx264.a common/mc.o common/predict.o common/pixel.o common/macroblock.o common/frame.o
common/dct.o common/cpu.o common/cabac.o common/common.o common/mdate.o common/set.o
common/quant.o common/vlc.o encoder/analyse.o encoder/me.o encoder/ratecontrol.o encoder/set.o
encoder/macroblock.o encoder/cabac.o encoder/cavlc.o encoder/encoder.o encoder/lookahead.o
common/x86/mc-c.o common/x86/predict-c.o common/x86/cabac-a.o common/x86/dct-a.o
common/x86/deblock-a.o common/x86/mc-a.o common/x86/mc-a2.o common/x86/pixel-a.o
common/x86/predict-a.o common/x86/quant-a.o common/x86/sad-a.o common/x86/cpu-a.o
common/x86/dct-32.o common/x86/pixel-32.o
ranlib libx264.a
gcc -o x264 x264.o input/yuv.o input/y4m.o output/raw.o output/matroska.o output/matroska_ebml.o
output/flv.o output/flv_bytestream.o input/thread.o input/lavf.o libx264.a -lm -lpthread -s -L. 
-pthread -L/usr/local/lib -lavformat -lavcodec -lz -lbz2 -ltheoraenc -ltheoradec -logg -lx264 -lm
-ldl -lswscale -lavutil   
/usr/local/lib/libavcodec.a(libx264.o): In function `X264_init':
/home/mimiller/sources/ffmpeg/libavcodec/libx264.c:285: undefined reference to `x264_encoder_open_79'
collect2: ld returned 1 exit status
make: *** [x264] Error 1

Please let me know what should be done about this error.
(Continue reading)

Jason Garrett-Glaser | 5 Mar 2010 21:49
Picon

Re: new to x264 and ffmpeg

On Fri, Mar 5, 2010 at 12:47 PM, Michael Miller
<mimiller <at> ncsa.illinois.edu> wrote:
> I'm new to x264 and ffmpeg, so please direct me to an alternate support source if appropriate.
>
> Today, I downloaded and tried to compile x264 for use with ffmpeg and got the following:
>
> x264]$ ./configure --enable-shared
> x264]$ make
>
> gcc -O3 -ffast-math  -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99  -I/usr/local/include  
-s -fomit-frame-pointer   -c -o input/thread.o input/thread.c
> gcc -O3 -ffast-math  -Wall -I. -march=i686 -mfpmath=sse -msse -std=gnu99  -I/usr/local/include  
-s -fomit-frame-pointer   -c -o input/lavf.o input/lavf.c
> ar rc libx264.a common/mc.o common/predict.o common/pixel.o common/macroblock.o common/frame.o
common/dct.o common/cpu.o common/cabac.o common/common.o common/mdate.o common/set.o
common/quant.o common/vlc.o encoder/analyse.o encoder/me.o encoder/ratecontrol.o encoder/set.o
encoder/macroblock.o encoder/cabac.o encoder/cavlc.o encoder/encoder.o encoder/lookahead.o
common/x86/mc-c.o common/x86/predict-c.o common/x86/cabac-a.o common/x86/dct-a.o
common/x86/deblock-a.o common/x86/mc-a.o common/x86/mc-a2.o common/x86/pixel-a.o
common/x86/predict-a.o common/x86/quant-a.o common/x86/sad-a.o common/x86/cpu-a.o
common/x86/dct-32.o common/x86/pixel-32.o
> ranlib libx264.a
> gcc -o x264 x264.o input/yuv.o input/y4m.o output/raw.o output/matroska.o output/matroska_ebml.o
output/flv.o output/flv_bytestream.o input/thread.o input/lavf.o libx264.a -lm -lpthread -s -L.
 -pthread -L/usr/local/lib -lavformat -lavcodec -lz -lbz2 -ltheoraenc -ltheoradec -logg -lx264 -lm
-ldl -lswscale -lavutil
> /usr/local/lib/libavcodec.a(libx264.o): In function `X264_init':
> /home/mimiller/sources/ffmpeg/libavcodec/libx264.c:285: undefined reference to `x264_encoder_open_79'
> collect2: ld returned 1 exit status
> make: *** [x264] Error 1
(Continue reading)

anton kropp | 2 Mar 2010 16:33
Picon

a question about low cpu usage parameter settings

Hi, I hope this isn't out of place for me to ask, but I'm trying to
tune x264 for a specific purpose and am having a hard time finding the
right set of parmaeters to do so. I am looking for something that will
have:

no b-frames
a bitrate of 650kb/s
low cpu impact

and if possible relative real time encoding

can anyone suggest any parameters for me to use for such a purpose?

again, thanks for helping out, i appreciate everyone's guidance.

-anton
_______________________________________________
x264-devel mailing list
x264-devel <at> videolan.org
http://mailman.videolan.org/listinfo/x264-devel

ashish shubham | 5 Mar 2010 23:34
Picon

Google Summer of Code 2010

Hi Jb,

I am Ashish, a student in India. I read about x264 and VLC project ideas at their soc ideas webpages. I found the x264 project regarding motion estimation using the GPU very interesting. Though, I have had little experience with video encoding, I have worked with CUDA on previous projects, that makes it exciting for me. Please tell me about the current state of this project as the webpage was meant to be for GSOC 2009.

Also, regarding the preliminary task related with the project, is it to be submitted along with the application or is it to be evaluated beforehand ?

Similarly, the Ideas related with the VLC player regarding GPU based decoding on Linux and windows are also very interesting, I saw one project was also completed on DXVA integration during gsoc 2009. Please tell me about the status and work expected for these projects too.

Thanks

-Ashish Shubham

_______________________________________________
x264-devel mailing list
x264-devel <at> videolan.org
http://mailman.videolan.org/listinfo/x264-devel
Jason Garrett-Glaser | 7 Mar 2010 03:23
Picon

Re: a question about low cpu usage parameter settings

On Tue, Mar 2, 2010 at 7:33 AM, anton kropp <akropp <at> gmail.com> wrote:
> Hi, I hope this isn't out of place for me to ask, but I'm trying to
> tune x264 for a specific purpose and am having a hard time finding the
> right set of parmaeters to do so. I am looking for something that will
> have:
>
> no b-frames
> a bitrate of 650kb/s
> low cpu impact
>
> and if possible relative real time encoding
>
> can anyone suggest any parameters for me to use for such a purpose?
>
> again, thanks for helping out, i appreciate everyone's guidance.
>
> -anton

Use the --preset options.  See x264 --help.

Dark Shikari
_______________________________________________
x264-devel mailing list
x264-devel <at> videolan.org
http://mailman.videolan.org/listinfo/x264-devel

Loïc Minier | 10 Mar 2010 09:29
Gravatar

[PATCH 2/2] Add IA64 arch to configure defaulting to pic="yes"

From: Loïc Minier <loic.minier <at> ubuntu.com>

---
 configure |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 8ed83ab..f06e621 100755
--- a/configure
+++ b/configure
 <at>  <at>  -393,6 +393,8  <at>  <at>  case $host_cpu in
   parisc|parisc64)
     ARCH="PARISC"
     ;;
+  ia64)
+    ARCH="IA64"
   *)
     ARCH="$(echo $host_cpu | tr a-z A-Z)"
     ;;
 <at>  <at>  -418,7 +420,7  <at>  <at>  elif cc_check '' -std=c99 ; then
     CFLAGS="$CFLAGS -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE"
 fi

-if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" \) ] ; then
+if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" -o $ARCH = "IA64" \)
] ; then
     pic="yes"
 fi

--

-- 
1.7.0

_______________________________________________
x264-devel mailing list
x264-devel <at> videolan.org
http://mailman.videolan.org/listinfo/x264-devel
Loïc Minier | 10 Mar 2010 09:29
Gravatar

[PATCH 1/2] Add <stdlib.h> include for abort()

From: Loïc Minier <loic.minier <at> ubuntu.com>

---
 common/display-x11.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/common/display-x11.c b/common/display-x11.c
index d659426..0245f85 100644
--- a/common/display-x11.c
+++ b/common/display-x11.c
 <at>  <at>  -21,6 +21,7  <at>  <at> 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>

 #include "display.h"
--

-- 
1.7.0

_______________________________________________
x264-devel mailing list
x264-devel <at> videolan.org
http://mailman.videolan.org/listinfo/x264-devel
Sean McGovern | 10 Mar 2010 14:15
Picon
Gravatar

Re: [PATCH 2/2] Add IA64 arch to configure defaulting topic="yes"

People actually still use Itaniums? Wow.
-----Original Message-----
From: Loïc Minier <lool <at> dooz.org>
Date: Wed, 10 Mar 2010 09:29:41 
To: <x264-devel <at> videolan.org>
Cc: Loïc Minier<loic.minier <at> ubuntu.com>
Subject: [x264-devel] [PATCH 2/2] Add IA64 arch to configure defaulting to
	pic="yes"

From: Loïc Minier <loic.minier <at> ubuntu.com>

---
 configure |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/configure b/configure
index 8ed83ab..f06e621 100755
--- a/configure
+++ b/configure
 <at>  <at>  -393,6 +393,8  <at>  <at>  case $host_cpu in
   parisc|parisc64)
     ARCH="PARISC"
     ;;
+  ia64)
+    ARCH="IA64"
   *)
     ARCH="$(echo $host_cpu | tr a-z A-Z)"
     ;;
 <at>  <at>  -418,7 +420,7  <at>  <at>  elif cc_check '' -std=c99 ; then
     CFLAGS="$CFLAGS -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE"
 fi

-if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" \) ] ; then
+if [ $shared = yes -a \( $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" -o $ARCH = "ARM" -o $ARCH = "IA64" \)
] ; then
     pic="yes"
 fi

--

-- 
1.7.0

_______________________________________________
x264-devel mailing list
x264-devel <at> videolan.org
http://mailman.videolan.org/listinfo/x264-devel
_______________________________________________
x264-devel mailing list
x264-devel <at> videolan.org
http://mailman.videolan.org/listinfo/x264-devel
Jason Garrett-Glaser | 10 Mar 2010 14:27
Picon

Re: [PATCH 2/2] Add IA64 arch to configure defaulting to pic="yes"

On Wed, Mar 10, 2010 at 12:29 AM, Loïc Minier <lool <at> dooz.org> wrote:
> From: Loïc Minier <loic.minier <at> ubuntu.com>
> ...

Applied both patches locally.
_______________________________________________
x264-devel mailing list
x264-devel <at> videolan.org
http://mailman.videolan.org/listinfo/x264-devel

Eeri Kask | 12 Mar 2010 14:20
Picon
Favicon

Evaluating x264 -- first steps encoding greylevel images

Hello,

being new to x264 and just a moment ago subscribed to this list let
me describe some issues I got stuck with while starting learning
x264 (and h264 in general).

I have a task to encode some intermediate numerical simulation image
data for efficient storage and later review. ("Efficient" storage in
the sense of replacing thousands of PNG frame files by a single,
preferrably lossless, or at least a "high-quality" video file.)
Having completed the simulation, in order to avoid manually recoding
these PNG files into a H264 file it would be purposeful to put some
x264-interface glue code to into that above simulation program in
order to create the H264 file on the fly.

So I investigated x264 a little and undertook some experimentation;
in particular, taking the x264.c source file as a learning sample I
tried to spot and extract the essential core parts in order to
achieve the following.  Given a file of stored raw 8-bit greylevel
data (the raw-file size is the number-of-frames times frame width
times frame height in bytes), then read this file from stdin and
output h264 stream into stdout.  The frame rate and frame size are
expected on the command line.  Let me attach the 90-line C source of
this tiny first application here as "Grey8_to_H264.c" which should
do exactly that.

Having compiled, the simplest use case for that small tool is
probably this:

    dd if=/dev/random count=100 bs=15000  \
            |  grey8_to_h264 10 150 100  >  random.h264

The first part creates 100 frames sized 150x100 of greylevel
random-noise, and the resulting h264 stream is stored in random.h264
as a 10 fps raw-video.

The problem with the above tool is, it either crashes x264, or sends
it into a possibly never-ending loop; depending if the only '#if 1'
in the above source is '1' or '0'.  I am using the latest git-source
of x264.

May I kindly ask anybody knowledgeable to give a quick look at this
source code to point out if there is some obvious problem with it;
and how it should be changed in order to complete the posed task...

Huge thanks in advance for any comments and suggestions,

    Eeri Kask

P.S. Compiling the above source against some considerably older x264
of 2009, it completes as expected but if then creating mp4 container
around random.h264 by

    MP4Box -add random.h264 -fps 10 -keep-sys -flat random.h264.mp4

then a mp4-stream with an interesting frame-size (probably due to
crf = 0 above) is created:

  AVC-H264 import - frame size 90 x -52 at 10.000 FPS
  Import results: 85 samples - Slices: 30 I 71 P 0 B - 2 SEI - 4 IDR
  Saving random.h264.mp4: Flat storage

but this is probably a completely different issue, unrelated to x264.

/*
    gcc -O1 -o ${HBIN:-.}/grey8_to_h264 Grey8_to_H264.c -lx264
    dd if=/dev/random count=100 bs=15000  |  grey8_to_h264 10 150 100 > random.h264
*/

#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <x264.h>

static int EncodeFrame (FILE *out, x264_t *h, x264_picture_t *pic)
{
    x264_picture_t  pic_out;
    x264_nal_t     *p_nal;
    int             i_nal, i_frame_size;

    i_frame_size = x264_encoder_encode (h, &p_nal, &i_nal, pic, &pic_out);
    if (i_frame_size < 0)
	fprintf (stderr, "EncodeFrame(): x264_encoder_encode() failed.\n");
    if (i_frame_size > 0)
	i_frame_size = fwrite (p_nal[0].p_payload, i_frame_size, 1, out);
    return i_frame_size;
}

static int Grey8_to_H264 (FILE *in, FILE *out, int fps, int width, int height)
{
    int c = 1;
    x264_t *h;
    x264_picture_t pic;
    x264_param_t param;
    x264_param_default (&param);
#if 1
    x264_param_parse (&param, "threads", "1"); /* <-- avoid endless loop*/
    x264_param_parse (&param, "crf", "0");     /* <-- enforce lossless encoding*/
#endif
    param.i_width = width;
    param.i_height = height;
    param.i_fps_num = fps;
    param.i_fps_den = 1;

    h = x264_encoder_open (&param);
    if (h != (x264_t*)(0)) {
	if (x264_picture_alloc (&pic, param.i_csp, param.i_width, param.i_height) == 0) {
	    x264_nal_t *p_nal;
	    int i_nal;
	    if (x264_encoder_headers (h, &p_nal, &i_nal) >= 0) {
		if (fwrite (p_nal[0].p_payload, (p_nal[0].i_payload + p_nal[1].i_payload + p_nal[2].i_payload),
1, out) > 0)
		{
		    int cnt = 0;
		    memset (pic.img.plane[1], /*u*/ 128, (param.i_width/2)*(param.i_height/2)); /*have no color*/
		    memset (pic.img.plane[2], /*v*/ 128, (param.i_width/2)*(param.i_height/2)); /*have no color*/

		    /*encode sequence*/
		    while (feof(in) == 0)
		    {
			for (c = 0; c < param.i_width*param.i_height && feof(in) == 0; ++c) /*read frame, i.e. 'y'*/
			    ((unsigned char*)(pic.img.plane[0]))[c] = (unsigned char)(fgetc(in));

			pic.i_pts = cnt++;           /* <-- what is this?*/
			pic.i_type = X264_TYPE_AUTO; /* <-- what is this?*/
			pic.i_qpplus1 = 0;           /* <-- what is this?*/
			if (EncodeFrame (out, h, &pic) < 0)
			    break;
		    }

		    /*flush*/
		    while (x264_encoder_delayed_frames (h) > 0)
			if (EncodeFrame (out, h, &pic) < 0)
			    break;
		    c = 0;
		}
	    }
	    x264_picture_clean (&pic);
	}
	x264_encoder_close (h);
    }
    return c;
}

int main (int argc, char *argv[])
{
    int fps, width, height;
    if (argc >= 4
	    && sscanf (argv[1], " %d", &fps) == 1 && fps > 0
	    && sscanf (argv[2], " %d", &width) == 1 && width > 0
	    && sscanf (argv[3], " %d", &height) == 1 && height > 0)
	return Grey8_to_H264 (stdin, stdout, fps, width, height);
    fprintf (stderr, "Usage:  %s  framerate  framewidth  frameheight  < grey8stream.data  > stream.h264\n", argv[0]);
    return 1;
}
_______________________________________________
x264-devel mailing list
x264-devel <at> videolan.org
http://mailman.videolan.org/listinfo/x264-devel

Gmane