Newest 'x264' Questions - Stack Overflow
Les articles publiés sur le site
-
ffmpeg 2nd pass segfault [migrated]
25 février 2014, par Mike FlynnI'm trying to get an old transcoding server up and running in a new environment and I'm experiencing some issues getting the well tested ffmpeg commands to work in the new environment.
It's a 2 pass encoding strategy, and the first pass runs just fine every time, the 2nd pass consistently fails with the following:
[libx264 @ 0x3925fc0] 2nd pass has more frames than 1st pass (1478) [libx264 @ 0x3925fc0] continuing anyway, at constant QP=14 [libx264 @ 0x3925fc0] disabling adaptive B-frames [libx264 @ 0x3925fc0] specified frame type is not compatible with max B-frames Segmentation fault
Here is the command we're using for each pass:
Pass 1:
ffmpeg -y -i input.mp4 -pass 1 -b 774000 -ab 128000 -s 640x360 -passlogfile ffmpeglog -vcodec libx264 -g 90 -bf 3 -refs 1 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp chroma -me_range 16 -me_method dia -subq 2 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -direct-pred 3 -trellis 0 -partitions -parti8x8-parti4x4-partp8x8-partb8x8 -r 30 -keyint_min 25 -wpredp 2 -rc_lookahead 50 -acodec libfaac -ar 44100 pass1.mp4
Pass 2:
ffmpeg -y -i pass1.mp4 -pass 2 -b 774000 -ab 128000 -s 640x360 -passlogfile ffmpeglog -vcodec libx264 -g 90 -bf 3 -refs 8 -b_strategy 1 -coder 1 -qmin 10 -qmax 51 -sc_threshold 40 -flags +loop -cmp chroma -me_range 16 -me_method umh -subq 9 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -direct-pred 3 -trellis 2 -partitions +parti8x8+parti4x4+partp8x8+partp4x4+partb8x8 -r 30 -keyint_min 25 -wpredp 2 -rc_lookahead 60 -acodec libfaac -ar 44100 pass2.mp4
...and here is my ffmpeg configuration:
ffmpeg version 2.1.4 Copyright (c) 2000-2014 the FFmpeg developers built on Feb 25 2014 19:23:21 with gcc 4.6.3 (GCC) 20120306 (Red Hat 4.6.3-2) configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-version3 --enable-libfaac --enable-nonfree libavutil 52. 48.101 / 52. 48.101 libavcodec 55. 39.101 / 55. 39.101 libavformat 55. 19.104 / 55. 19.104 libavdevice 55. 5.100 / 55. 5.100 libavfilter 3. 90.100 / 3. 90.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 17.104 / 0. 17.104 libpostproc 52. 3.100 / 52. 3.100 Hyper fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Any ideas would be greatly appreciated!
-
x264 NALUs serialization and handling
4 février 2014, par dtumaykinI have my x264 encoder, producing NALUs from a raw video stream. I need to send those NALUs over the network. What is the best way of doing so?
Encoder is inserted into a DirectShow graph, it's a transform filter and downstream I have the filter which handles networking. Can I pass NALUs, created by transform filter directly to network "render" filter? Will it create some memory issues?
I would like to know how memory allocated for NALUs is handled inside x264 - who is responsible for freeing it? Also I'm wondering if I can just serialize NALU to a bit stream manually and then rebuild it in the same way?
-
How to dump the H264/RTP stream to a file without losing time info ?
3 février 2014, par Fernando SilveiraI coded an application to receive RTP packets via TCP (no packets are lost) from a hardware camera and dump its H264 packets to a file so I could play the video using MPlayer or VLC. This is already working and I pretty much did the steps described here. The commands to play the video are
mplayer -fps 24 -demuxer h264es foobar.h264
andvlc foobar.h264
.The issue is now when I play the video. The camera changes the FPS frequently and because I drop the RTP info when writing the H264 file, the timestamp of each frame is lost. My question is: what do I have to do to fix the frame frequency? Should I create empty/blank P-frames (if that is possible)? If so, how would I do it?
Any solution using Linux compatible tools or libraries (like ffmpeg, libx264, libavcodec) using shell, C/C++ or Python is very much welcome.
PS: I have almost no experience with video encoding and RTP.
-
How multiple DirectShow buffers work ?
3 février 2014, par dtumaykinDirectShow filters allow to allocate multiple buffers in DecideBufferSize.
I have a transform filter that encodes raw frames with x264, generating 1+ NALs to pass upstream to next filter. I thought that allocating a pool of buffers for NALs can be a solution, but I can't figure out how to access all the buffers I've allocated before.
Maybe, there is a better way to solve the problem - allocate one big buffer and pass all the NALs inside?
-
libx264 compiled with MinGW - missing __umoddi3, __udivdi3, _fseeko64 and __chkstk_ms
31 janvier 2014, par dtumaykinI'm willing to use x264 in my Windows project, so I've build the library from source using MinGW and gcc into a static library.
The library and the header are included correctly, the only problem is that linker now complains, because __umoddi3, __udivdi3, _fseeko64 and __chkstk_ms. Looks like this functions are a part of some standard library, but where can I find it in Windows?
Thanks.