Newest 'x264' Questions - Stack Overflow
Les articles publiés sur le site
-
How to achieve 2 pass encoding using x264 ?
6 avril 2017, par Kim Kardashianis there a parameter in the x264_param_t structure or do I have to send frames to x264 dll twice.. ? Because I just use encoder_encode function and that returns nal units . Im guessing it should be a combination of a parameter and using encoder_encode twice.
Here is how i initialize params and link to libx264
InitializeSettings(){ x264_param_default_preset(&m_pXParam, "medium", "zerolatency"); x264_param_apply_profile(&m_pXParam, "baseline"); m_pXParam.i_width = cx; m_pXParam.i_height = cy; m_pXParam.i_fps_num = fps; m_pXParam.i_fps_den = 1; // rate control m_pXParam.i_keyint_max = fps - 5; //m_pXParam.rc.f_rf_constant_max = fps + 5; // rate control m_pXParam.rc.i_qp_constant=18; m_pXParam.rc.i_qp_min=18; m_pXParam.rc.i_qp_max=18;} x264_picture_alloc(&m_xPicture, X264_CSP_I420 , m_pXParam.i_width, m_pXParam.i_height); m_xPicture.img = x264img; m_iframe_size = x264_encoder_encode(m_xEncoder, &m_xNals, &m_iNal, &m_xPicture, &m_xPictureOut);
@nobody555 Thanks! I had another question about x264_param_apply_fastfirstpass function:
/* x264_param_apply_fastfirstpass: * If first-pass mode is set (rc.b_stat_read == 0, rc.b_stat_write == 1), * modify the encoder settings to disable options generally not useful on * the first pass. */
what options are they talking about ?
-
GStreamer x264enc not found
5 avril 2017, par Dominik SchreiberI installed GStreamer-0.10 and all modules (base, good, bad, ugly, ffmpeg) according to these instructions (browse through by clicking prev/next): http://www.linuxfromscratch.org/blfs/view/svn/multimedia/gst-plugins-ugly.html
Everything seemed to have worked just fine but when I want to execute my pipeline I got this error:
glib.GError: no element "x264enc"
Apparently the module was not installed:
gst-inspect x264enc No such element or plugin 'x264enc'
After that I installed the codec by executing:
sudo apt-get install x264
This did not work either. So I installed the latest build manually: http://www.videolan.org/developers/x264.html
After a successful installation of x264 I ran ./configure on the gstreamer-0.10 ugly modules once again and found out about this:
configure: *** checking feature: x264 plug-in *** configure: *** for plug-ins: x264 *** checking for X264... no configure: No package 'x264' found configure: *** These plugins will not be built: x264 configure: creating ./config.status
A check if x264 is available seems to get fullfilled:
which x264 /usr/local/bin/x264
I'm using ubuntu server 12.04 LTS. Any ideas what I have to do to compile this module properly? Thanks!
-
GStreamer x264enc not found
5 avril 2017, par Dominik SchreiberI installed GStreamer-0.10 and all modules (base, good, bad, ugly, ffmpeg) according to these instructions (browse through by clicking prev/next): http://www.linuxfromscratch.org/blfs/view/svn/multimedia/gst-plugins-ugly.html
Everything seemed to have worked just fine but when I want to execute my pipeline I got this error:
glib.GError: no element "x264enc"
Apparently the module was not installed:
gst-inspect x264enc No such element or plugin 'x264enc'
After that I installed the codec by executing:
sudo apt-get install x264
This did not work either. So I installed the latest build manually: http://www.videolan.org/developers/x264.html
After a successful installation of x264 I ran ./configure on the gstreamer-0.10 ugly modules once again and found out about this:
configure: *** checking feature: x264 plug-in *** configure: *** for plug-ins: x264 *** checking for X264... no configure: No package 'x264' found configure: *** These plugins will not be built: x264 configure: creating ./config.status
A check if x264 is available seems to get fullfilled:
which x264 /usr/local/bin/x264
I'm using ubuntu server 12.04 LTS. Any ideas what I have to do to compile this module properly? Thanks!
-
x264 stream color shift
15 mars 2017, par useprxfI was using swscale + x264 to encode a sequence of RGB images to an h264 stream. When the RGB values in the input image (in red) are all
(255, 0, 0)
, the YUV outputted by swscale + x264 is(81, 90, 240)
. By using swscale, this YUV value can be transformed back to the original RGB value. However there is color shifting when I used PotPlayer to play the stream.I captured the first frame and saved it as a bmp file. The RGB value in the bmp file is
(255, 24, 0)
, where the green channel is not zero.How to solve this color-shift problem?
I solve this problem by changing the ITU-601 color space to ITU-709 using
sws_setColorspaceDetails
. -
x264 stream color shift
15 mars 2017, par useprxfI was using swscale + x264 to encode a sequence of RGB images to an h264 stream. When the RGB values in the input image (in red) are all
(255, 0, 0)
, the YUV outputted by swscale + x264 is(81, 90, 240)
. By using swscale, this YUV value can be transformed back to the original RGB value. However there is color shifting when I used PotPlayer to play the stream.I captured the first frame and saved it as a bmp file. The RGB value in the bmp file is
(255, 24, 0)
, where the green channel is not zero.How to solve this color-shift problem?
I solve this problem by changing the ITU-601 color space to ITU-709 using
sws_setColorspaceDetails
.