Newest 'x264' Questions - Stack Overflow
Les articles publiés sur le site
-
Reading x264 bitstream using JM Reference
31 janvier 2012, par JasonI have encoded a video to a raw 264 bitstream using x264. JM decoder correctly decode the video. However, when I try to extract the modes and motion vectors of the macroblock by printing out the macroblock info, they print out the wrong values. Have anyone experience these before ?
-
Compiling ffmpeg with mingw + libx264
31 janvier 2012, par PatI'm installed most necessary components to build ffmpeg and x264. Here's the process:
Launched msys, went ahead and moved the x264 source folder, ran the following configure with make and make install after:
./configure --enable-static --enable-shared --enable-win32thread
Worked like a charm, had my .dll's, the .a link file.
Moved over to ffmpeg's folder, downloaded the source from zeranoe's build website, ran the following procedure:
export CPPFLAGS="$CPPFLAGS -IC:/MinGW/msys/1.0/local/include" export LDFLAGS="$LDFLAGS -LC:/MinGW/msys/1.0/local/lib" ./configure --enable-shared --enable-decoder=h264 --enable-w32threads --enable-gpl --enable-libx264 --extra-libs=C:/MinGW/msys/1.0/local/lib/libx264.a --extra-cflags=-IC:/MinGW/msys/1.0/local
I do the make, and it fails after 5 minutes: http://pastie.org/3290141
-
Linking to libx264 library from c code Ubuntu
30 janvier 2012, par Martin ConaghanI'm trying to write a small C application which uses the x264 API, and I'm having problems compiling the code with a link to the x264 libaray.
In the /project/ directory there are two sub-folders: /project/mycode/ and /project/x264-snapshot-20120120-2245.
I have installed x264 in the latter subdirectory using ./configure and then 'make'. As such the library I think I want to link to is /project/x264-snapshot-20120120-2245/libx264.a
In /project/mycode/ I have a single source code file (prototype.c), which has the following imports:
#include #include #include "../x264-snapshot-20120120-2245/x264_config.h" #include "../x264-snapshot-20120120-2245/x264.h"
As expected, if I try to compile without linking to the x264 library, I get an error:
/project/mycode: gcc -o prototype prototype.c /tmp/cc5NwRTp.o: In function `main': prototype.c:(.text+0x6c): undefined reference to `x264_param_default_preset' prototype.c:(.text+0xf6): undefined reference to `x264_param_apply_profile' collect2: ld returned 1 exit status
So I try to link the library I mentioned above, but it isn't found:
/project/mycode: gcc -o prototype prototype.c -I../x264-snapshot-20120120-2245/ -llibx264.a /usr/bin/ld: cannot find -llibx264.a collect2: ld returned 1 exit status
I've tried a few variations, like:
gcc -o prototype prototype.c -I../x264-snapshot-20120120-2245/ -l ../x264-snapshot-20120120-2245/libx264.a gcc -o prototype prototype.c -I../x264-snapshot-20120120-2245/ -llibx264 gcc -I ../x264-snapshot-20120120-2245/ -llibx264.a -o prototype prototype.c
As is probably obvious by now, I'm fairly new to this, so I'm hoping there is an easy solution
-
x264 & libavcodec
25 janvier 2012, par mooseAfter some considerable amount of time while trying to build the ffmpeg static library with the x264 encoder on Windows, I have spent some more time for writing some example with it. Of course, there are tons of "instructions" on how to build, how to use, bla bla... But, non of them works on Windows. I guess the Linux guys are in better position here. Now, the zillion dollars question is "What's the purpose of all that?". Not only that this is useless on Windows, but I could have bought some third party library that actually works.
If somebody is about to say "But, it works!". I must say, give me a working proof. I don't care about 200x100 at 10fps. I don't need H264 for that. Show me how to compress a single second of 1080i footage. It's H264, it's crossplatform (sounds funny if you ask me), Google is using it (it has to be perfect, right?), some more hipe here...
-
Why does use of H264 in sender/receiver pipelines introduce just HUGE delay ?
24 janvier 2012, par Serguey ZefirovWhen I try to create pipeline that uses H264 to transmit video, I get some enormous delay, up to 10 seconds to transmit video from my machine to... my machine! This is unacceptable for my goals and I'd like to consult StackOverflow over what I (or someone else) do wrong.
I took pipelines from gstrtpbin documentation page and slightly modified them to use Speex:
This is sender pipeline: #!/bin/sh
gst-launch -v gstrtpbin name=rtpbin \ v4l2src ! ffmpegcolorspace ! ffenc_h263 ! rtph263ppay ! rtpbin.send_rtp_sink_0 \ rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5000 \ rtpbin.send_rtcp_src_0 ! udpsink host=127.0.0.1 port=5001 sync=false async=false \ udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 \ pulsesrc ! audioconvert ! audioresample ! audio/x-raw-int,rate=16000 ! \ speexenc bitrate=16000 ! rtpspeexpay ! rtpbin.send_rtp_sink_1 \ rtpbin.send_rtp_src_1 ! udpsink host=127.0.0.1 port=5002 \ rtpbin.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=5003 sync=false async=false \ udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1
Receiver pipeline:
!/bin/sh
gst-launch -v\ gstrtpbin name=rtpbin \ udpsrc caps="application/x-rtp,media=(string)video, clock-rate=(int)90000, encoding-name=(string)H263-1998" \ port=5000 ! rtpbin.recv_rtp_sink_0 \ rtpbin. ! rtph263pdepay ! ffdec_h263 ! xvimagesink \ udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \ rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false \ udpsrc caps="application/x-rtp,media=(string)audio, clock-rate=(int)16000, encoding-name=(string)SPEEX, encoding-params=(string)1, payload=(int)110" \ port=5002 ! rtpbin.recv_rtp_sink_1 \ rtpbin. ! rtpspeexdepay ! speexdec ! audioresample ! audioconvert ! alsasink \ udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \ rtpbin.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=5007 sync=false async=false
Those pipelines, a combination of H263 and Speex, work fine enough. I snap my fingers near camera and micropohne and then I see movement and hear sound at the same time.
Then I changed pipelines to use H264 along the video path.
The sender becomes: #!/bin/sh
gst-launch -v gstrtpbin name=rtpbin \ v4l2src ! ffmpegcolorspace ! x264enc bitrate=300 ! rtph264pay ! rtpbin.send_rtp_sink_0 \ rtpbin.send_rtp_src_0 ! udpsink host=127.0.0.1 port=5000 \ rtpbin.send_rtcp_src_0 ! udpsink host=127.0.0.1 port=5001 sync=false async=false \ udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 \ pulsesrc ! audioconvert ! audioresample ! audio/x-raw-int,rate=16000 ! \ speexenc bitrate=16000 ! rtpspeexpay ! rtpbin.send_rtp_sink_1 \ rtpbin.send_rtp_src_1 ! udpsink host=127.0.0.1 port=5002 \ rtpbin.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=5003 sync=false async=false \ udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1
And receiver becomes: #!/bin/sh
gst-launch -v\ gstrtpbin name=rtpbin \ udpsrc caps="application/x-rtp,media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264" \ port=5000 ! rtpbin.recv_rtp_sink_0 \ rtpbin. ! rtph264depay ! ffdec_h264 ! xvimagesink \ udpsrc port=5001 ! rtpbin.recv_rtcp_sink_0 \ rtpbin.send_rtcp_src_0 ! udpsink port=5005 sync=false async=false \ udpsrc caps="application/x-rtp,media=(string)audio, clock-rate=(int)16000, encoding-name=(string)SPEEX, encoding-params=(string)1, payload=(int)110" \ port=5002 ! rtpbin.recv_rtp_sink_1 \ rtpbin. ! rtpspeexdepay ! speexdec ! audioresample ! audioconvert ! alsasink \ udpsrc port=5003 ! rtpbin.recv_rtcp_sink_1 \ rtpbin.send_rtcp_src_1 ! udpsink host=127.0.0.1 port=5007 sync=false async=false
This is what happen under Ubuntu 10.04. I didn't noticed such huge delays on Ubuntu 9.04 - the delays there was in range 2-3 seconds, AFAIR.