Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
How to compile ffmpeg for qt use in windows
13 avril 2016, par HimikoI want to use ffmpeg libs for programming in QT. And I want to ask is that
1、How can I compile ffmpeg into *.lib files in windows ?
2、Or how can I use the compiled *.dll files which are released officially in qt. Which way is better? Thank you very much.
-
Why sliced thread affect so much on realtime encoding using ffmpeg x264 ?
13 avril 2016, par CurtisGuoI'm using ffmpeg libx264 to encode a 720p screen captured from x11 in realtime with a fps of 30. when I use -tune zerolatency paramenter, the average encode time per-frame can be as large as 12ms with profile baseline.
After a study of the ffmpeg x264 source code, I found that the key parameter leading to such long encode time is sliced-threads which enabled by -tune zerolatency. After disabled using -x264-params sliced-threads=0 the encode time can be as low as 2ms
And with sliced-threads disabled, the CPU usage will be 40%, while only 20% when enabled.
Can someone explain the details about this sliced-thread? Especially in realtime encoding(assume no frame is buffered to be encoded. only encode when a frame is captured).
-
avconv : from multiple png to movie not exporting correctly
13 avril 2016, par abhraI am trying to generate a mp4 movie from a set of pngs using avconv on my debian8 system. The mp4 file its generating basically looping over the first figure for some time. Here is the command I am using
avconv -r 10 -start_number 8 -i images_%06d.png -b:v 1000k -vf scale=640:-1 test.mp4
Output is
avconv version 11.6-6:11.6-1~deb8u1, Copyright (c) 2000-2014 the Libav developers built on Mar 2 2016 23:00:02 with gcc 4.9.2 (Debian 4.9.2-10) Input #0, image2, from 'images_%06d.png':
Duration: 00:00:16.00, start: 0.000000, bitrate: N/A Stream #0.0: Video: png, rgb24, 2400x1801, 25 fps, 25 tbn File 'test.mp4' already exists. Overwrite ? [y/N] y [scale @ 0x820c60] The ::flags= option syntax is deprecated. Use either :: or w=:h=:flags=. [libx264 @ 0x837760] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2 [libx264 @ 0x837760] profile High, level 2.2 [libx264 @ 0x837760] 264 - core 142 r2431 a5831aa - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - 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=250 keyint_min=10 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=1000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'test.mp4': Metadata: encoder : Lavf56.1.0 Stream #0.0: Video: libx264, yuv420p, 640x480, q=-1--1, 1000 kb/s, 10 fps, 10 tbn, 10 tbc Metadata: encoder : Lavc56.1.0 libx264 Stream mapping: Stream #0:0 -> #0:0 (png (native) -> h264 (libx264)) Press ctrl-c to stop encoding frame= 17 fps= 0 q=0.0 size= 0kB time=10000000000.00 bitrate= 0.0kbitframe= 34 fps= 32 q=0.0 size= 0kB time=10000000000.00 bitrate= 0.0kbitframe= 51 fps= 32 q=0.0 size= 0kB time=10000000000.00 bitrate= 0.0kbitframe= 393 fps= 32 q=0.0 Lsize= 139kB time=39.00 bitrate= 29.2kbits/s video:132kB audio:0kB other streams:0kB global headers:0kB muxing overhead: 5.284794% [libx264 @ 0x837760] frame I:2 Avg QP: 3.69 size: 51320 [libx264 @ 0x837760] frame P:99 Avg QP: 0.32 size: 242 [libx264 @ 0x837760] frame B:292 Avg QP: 0.15 size: 26 [libx264 @ 0x837760] consecutive B-frames: 0.8% 0.5% 0.0% 98.7% [libx264 @ 0x837760] mb I I16..4: 45.5% 19.2% 35.3% [libx264 @ 0x837760] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 0.9% 0.0% 0.0% 0.0% 0.0%
skip:99.0% [libx264 @ 0x837760] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.2% 0.0% 0.0% direct: 0.0% skip:99.8% L0:22.3% L1:77.7% BI: 0.0% [libx264 @ 0x837760] final ratefactor: -21.09 [libx264 @ 0x837760] 8x8 transform intra:18.9% inter:41.7% [libx264 @ 0x837760] coded y,uvDC,uvAC intra: 34.1% 0.0% 0.0% inter: 0.1% 0.0% 0.0% [libx264 @ 0x837760] i16 v,h,dc,p: 81% 14% 5% 0% [libx264 @ 0x837760] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 49% 14% 36% 0% 0% 0% 0% 0% 0% [libx264 @ 0x837760] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 28% 19% 3% 3% 2% 4% 2% 3% [libx264 @ 0x837760] i8c dc,h,v,p: 100% 0% 0% 0% [libx264 @ 0x837760] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 @ 0x837760] ref P L0: 99.3% 0.0% 0.6% 0.1% [libx264 @ 0x837760] ref B L0: 4.2% 95.8% [libx264 @ 0x837760] ref B L1: 99.8% 0.2% [libx264 @ 0x837760] kb/s:27.34I have also tried
cat *.png | avconv -f image2pipe -i - -b:v 1000k -vf scale=640:-1 test2.mp4
output shows
avconv version 11.6-6:11.6-1~deb8u1, Copyright (c) 2000-2014 the Libav developers built on Mar 2 2016 23:00:02 with gcc 4.9.2 (Debian 4.9.2-10) Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (test2.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream. Output #0, image2pipe, to 'test2.mp4': Output file #0 does not contain any stream
When getting frames fromtest.mp4
avconv -i test.mp4 -r 30 -f image2 %04d.png
I found 1000 or more copies of the images_000001.png.
Would you please help, whether I have made any mistake in commands? Or am I missing some codec options? Thanks for the help.
-
Why does compressed buffer needs to be bigger than input buffer in LZW compression ?
13 avril 2016, par Sir DrinksCoffeeALotI'm currently working on implementing LZW compression and decompression methods from FFmpeg source code to my project. What i stumbled upon is that the size of output buffer (where compressed data will be stored) needs to be bigger than size of input buffer that we want to compress. Isn't that contradictionary to the compression itself?
Next part of the code is located in ff_lzw_encode() function which is part of lzwenc.c source file.
if (insize * 3 > (s->bufsize - s->output_bytes) * 2) { printf("Size of output buffer is too small!\n"); return -1; }
For my particular example, i'm trying to compress raw video frames before sending them locally. But if i allocate memory for a buffer that is size of
(insize * 3) / 2
(where compressed data will be stored), wouldn't that take more time to send usingsend()
function than sending raw buffer which is size ofinsize
? -
Load only the next 10min of HTML video when it is playing - not the entire video
13 avril 2016, par W3ApeI have videos on my website with duration of almost 2h (=> large file size).
I have managed to convert them to h265 to reduce server load. To further reduce server load I also want the video to only load e.g. the next 10min from the point the user currently is at in the video (and not the entire video). Youtube is doing it this way.
The HTML preload attribute does not have this option. Is there such a feature in ffmpeg (or anywhere else)?
Thanks for a hint