Newest 'libx264' Questions - Stack Overflow
Les articles publiés sur le site
-
X264 : How to access NAL units from encoder ?
18 avril 2014, par user1884325When I call
frame_size = x264_encoder_encode(encoder, &nals, &i_nals, &pic_in, &pic_out);
and subsequently write each NAL to a file like this:
if (frame_size >= 0) { int i; int j; for (i = 0; i < i_nals; i++) { printf("******************* NAL %d (%d bytes) *******************\n", i, nals[i].i_payload); fwrite(&(nals[i].p_payload[0]), 1, nals[i].i_payload, fid); } }
then I get this
My questions are:
1) Is it normal that there's readable parameters in the beginning of the file?
2) How do I configure the X264 encoder so that the encoder returns frames that I can send via UDP without the packet getting fragmented (size must be below 1390 or somewhere around that).
3) With the x264.exe I pass in these options:
"--threads 1 --profile baseline --level 3.2 --preset ultrafast --bframes 0 --force-cfr --no-mbtree --sync-lookahead 0 --rc-lookahead 0 --keyint 1000 --intra-refresh"
How do I map those to the settings in the X264 parameters structure ? (x264_param_t)
4) I have been told that the x264 static library doesn't support bitmap input to the encoder and that I have to use libswscale for conversion of the 24bit RGB input bitmap to YUV2. The encoder, supposedly, only takes YUV2 as input? Is this true? If so, how do I build libswscale for the x264 static library?
-
ffserver Error writing frame to output
28 mars 2014, par GarciaPLI am new to ffmpeg and ffserver. I spent a lot of time to stream the .avi file using ffserver. Below is my config.
Port 8090 # Port to bind the server to BindAddress 0.0.0.0 MaxHTTPConnections 2000 MaxClients 1000 MaxBandwidth 10000 # Maximum bandwidth per client # set this high enough to exceed stream bitrate CustomLog - NoDaemon # Remove this if you want FFserver to daemonize after start RTSPPort 7654 RTSPBindAddress 0.0.0.0
# This is the input feed where FFmpeg will send File ./feed1.ffm # video stream. FileMaxSize 1G # Maximum file size for buffering video ACL allow 127.0.0.1 ACL allow 192.168.0.0 192.168.0.255 Format avi Feed feed1.ffm VideoCodec libvpx VideoFrameRate 30 VideoBitRate 800 VideoSize 720x576 AudioCodec aac Strict -2 AudioBitRate 128 AudioChannels 2 AudioSampleRate 44100 AVOptionAudio flags +global_header # Server status URL Format status ACL allow localhost ACL allow 192.168.0.0 192.168.255.255 # Just an URL redirect for index, Redirect index.html to the appropriate site URL http://www.ffmpeg.org/ So, to start my ffserver I use this command :
ffserver -d -f ffserver.conf
and after that I start stream of this avi file using ffmpeg :
ffmpeg -re -i russian.avi -c:v libx264 -loop 1 http://192.168.1.165:8090/feed1.ffm
unfortunately I received two errors repeated many of times :
Too large number of skipped frames 60120709615 > 60000 Error writing frame to output
I searched the entire internet....but I found nothing what would be valuable.
-
ffmpeg convert from WMV to AVC1 instead of "official" H264 [closed]
26 mars 2014, par thipetoI searched google for an answer, but I can't find the solution. It's for professional use.
I'm trying to convert some wmv files (WMV3) to MP4 (H.264). It should take the format h.264, and instead of it, it's taken the H.264 (AVC1) format.
It seems like the AVC is a format used in Apple, and I don't want to convert to this format, only to h264 "official", the one who fourcc shows me. I'm using the last version of ffmpeg, following is the basic command that I'm using:
ffmpeg -i input.wmv -c:v libx264 -q:v 0 output.mp4
I'm trying to understand the reason that some PCs here convert to h264, and other to AVC1. Someone can help me? What should I do to make the other PCs convert to the real h.264 without install a pack of codecs? I just want to convert to mp4, there's a way to install only codecs to convert to mp4?
Many thanks, Thiago.
-
x264 : Using NAL size limitation ruines the stream
25 mars 2014, par Dan TumaykinI'm using x264 to compress a video stream from a webcam with this settings:
x264_param_default_preset(¶m, "veryfast", "zerolatency"); param.i_threads = 1; param.i_fps_den = 1; param.b_annexb = 1; param.i_keyint_max = 30; param.rc.i_rc_method = X264_RC_CRF; param.rc.f_rf_constant = 25; param.rc.f_rf_constant_max = 35; param.b_repeat_headers = 1; x264_param_apply_profile(¶m, "baseline"); param.i_slice_max_size = X264_NAL_MAX_SIZE;
I would like to fit NAL into MTU size, but if I set a small max size, the stream is ruined - it blinks randomly between black and white, with some clues of original image in background. The bigger is the max_size, less probable is for the stream to be ruined. So my question is - can we have small NALUs and a correct video stream?
UPD: I use FFmpeg as a decoder.
-
How to check 'Output bit depth' of the libx264 library in ffmpeg ?
25 mars 2014, par AmiramixAccording to the x264 Encoding Guide, the
crf
scale depends on whether x264 is 8-bit or 10-bit. Supposedlyx264 --help
shows theOutput bit depth
. But on Windowsffmpeg -h full
doesn't say anything aboutOutput bit depth
and thecrf
scale option is described asfrom -1 to FLT_MAX
. How can I check if my ffmpeg is using 8-bit or 10-bit version of the libx264 library?