Newest 'libx264' Questions - Stack Overflow
Les articles publiés sur le site
-
How to deal ffplay being too slow playing iPhone's videos ?
8 janvier 2020, par Mikhail T.Trying to play a 3840x2160 video recorded by an iPhone 7 (@30fps), I get frequent pauses -- in the video, music keeps playing.
This happens both in firefox and when
ffplay
is invoked to play the file directly -- from command-line. The CPU is a dual E6700 @3.20GHz -- not super fast, but it should be able to play smoothly, shouldn't it? Video is Intel's "series 4" integrated chipset -- again, not a speed-daemon, but it should be adequate... Support for Intel's VA API is included.I build ffmpeg-4.1 from source using FreeBSD port. As you can see, the port has a maddening amount of options -- including several different ones for the 264-codec.
Any suggestions for improving the decoding speed to the point, where it is watchable by a human? Thank you!
-
libavcodec/libx264 isn't respecting keyint_min
6 janvier 2020, par seanr8Using libavcodec 57.107.100, I have some code to encode frames into H.264 and I'm working on tweaking the settings to prep resulting videos to be streamed with DASH, which requires consistent keyframe timings. So I'm setting the GOP to 4x the framerate and setting the keyint_min to the same as the GOP so that I can guarantee that the keyframe interval lines up with the 4 second segment boundaries.
I'm using the following code to build the AVCodec and AVCodecContext:
AVCodec* codec = NULL; codec = avcodec_find_encoder_by_name("libx264"); AVCodecContext* avcodec_context = avcodec_alloc_context3(codec); context->bit_rate = 200000; context->height = 640; context->width = 480; context->keyint_min = 100; context->gop_size = 100; context->qmax = 31; context->qmin = 2; context->pix_fmt = AV_PIX_FMT_YUV420P; context->time_base = (AVRational) {1, 25};
Clearly, the keyint_min is 100 here, yet when I execute my program, the stderr output from libavcodec says this when the encoding starts:
[libx264 @ 0x5577bde61f20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 [libx264 @ 0x5577bde61f20] profile High, level 3.0 [libx264 @ 0x5577bde61f20] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=100 keyint_min=51 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=200 ratetol=1.0 qcomp=0.60 qpmin=2 qpmax=31 qpstep=4 ip_ratio=1.40 aq=1:1.00
For emphasis, in the third line of that blurb, the encoder says keyint=100 keyint_min=51. So obviously my GOP is being set correctly at 100, but the keyint_min is not being respected. Since the FFMPEG docs are pretty difficult to approach, I haven't been able to find an answer to this. Does anyone know what I'm missing?
-
what is the lowest allowed framerate of VP9 codec
5 janvier 2020, par d3imI was searching over Net to find what is the lowest allowed framerate of VP9 but didn't find anything. I'm asking because I successfully encoded video at 0.25 or 1 FPS to x264 or x265, but with VP9 it gives me an error on that framerates.
-
Remove extra SPS and PPS from h264 stream
3 janvier 2020, par izamblI have some screen recordings taken with Chrome MediaStream, but Mac Chrome 79 introduced a bug (https://bugs.chromium.org/p/chromium/issues/detail?id=1034633) that breaks some of the videos because of the way SPS and PPS are handled.
I found out that if I reencode the video with
ffmpeg -i video.mp4 -c:v libx264 video1.mp4
it works but it takes too long to process, so I was thinking on converting the stream to AVCC or maybe another way of removing any extra SPS and PPS data so chrome won't use SPS and PPS from IDR slice headers.I tried using FFmpeg Bitstream Filters but I couldn't get a working video.
Is it possible to do without reencoding the full video?
-
ffmpeg x264 CPU core scaling
15 décembre 2019, par alex416Does anyone have any experence with this type of thing? Currently using a Ryzen 7 8c/16T CPU, and using a program called BES. Using 10% CPU, is almost no slower at transcoding from mkv to mp4 (both x264, i know i can just copy them) than using 100% cpu on all 16 threads. So, Since this is the case, What is the ideal core count for libx264? I mean, Does the same type of thing happen with 32 threads? Or 8 threads, etc.