[FFmpeg-user] VSYNC 1
Sven Dueking
sven at nablet.com
Tue Mar 13 14:13:37 CET 2012
Hi Carl,
Many thanks for your fast feedback.
My assumption based on the different behavior if I use one or two
transcodes.
Same behavior if the instances are started parallel.
And I also noticed a reduced number of dropped / duped frames with subme = 0
for instance.
But maybe I made just a simple mistake ..
Anyway, thanks again for your help and time.
Best,
Sven
Command line is :
ffmpeg \
-f alsa -ac 2 -i hw:0,1 \
-f x11grab -s 1280x720 -r 30 -g 30 -i :1.0 -vsync 1 -vcodec libx264 -aspect
16:9 -b:v 3000k -s 1280x720 -g 30 -r 30 \
-acodec libfaac -ac 2 -ar 44100 -ab 96k \
-x264opts no-mbtree:bframes=0:rc_lookahead=0:ref=2:subme=5 \
-f flv -y rtmp://178.63.185.152:1936/live/channel1 \
-vcodec libx264 -aspect 16:9 -b:v 2000k -s 852x480 -g 30 -r 30 \
-x264opts no-mbtree:bframes=0:rc_lookahead=0:ref=2:subme=5 \
-f flv -y rtmp://178.63.185.152:1936/live/channel2
Console output :
root at ip-10-248-105-212:~# ./multi.sh
ffmpeg version 0.10 Copyright (c) 2000-2012 the FFmpeg developers
built on Mar 9 2012 15:14:17 with gcc 4.6.1
configuration: --enable-gpl --enable-version3 --enable-nonfree
--enable-pthreads --enable-libfaac --enable-libx264 --enable-x11grab
--enable-librtmp --enable-postproc --enable-bzlib --enable-zlib
--enable-swscale
libavutil 51. 34.101 / 51. 34.101
libavcodec 53. 60.100 / 53. 60.100
libavformat 53. 31.100 / 53. 31.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 60.100 / 2. 60.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
[alsa @ 0x1841420] Estimating duration from bitrate, this may be inaccurate
Input #0, alsa, from 'hw:0,1':
Duration: N/A, start: 1331644039.931867, bitrate: N/A
Stream #0:0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
[x11grab @ 0x18581a0] device: :1.0 -> display: :1.0 x: 0 y: 0 width: 1280
height: 720
[x11grab @ 0x18581a0] shared memory extension found
[x11grab @ 0x18581a0] Estimating duration from bitrate, this may be
inaccurate
Input #1, x11grab, from ':1.0':
Duration: N/A, start: 1331644039.971963, bitrate: 884736 kb/s
Stream #1:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1280x720, 884736
kb/s, 30 tbr, 1000k tbn, 30 tbc
HandShake: client signature does not match!
HandShake: client signature does not match!
Incompatible pixel format 'bgra' for codec 'libx264', auto-selecting format
'yuv420p'
[buffer @ 0x1865640] w:1280 h:720 pixfmt:bgra tb:1/1000000 sar:0/1
sws_param:
[buffersink @ 0x1896620] auto-inserting filter 'auto-inserted scale 0'
between the filter 'src' and the filter 'out'
[scale @ 0x1897f00] w:1280 h:720 fmt:bgra -> w:1280 h:720 fmt:yuv420p
flags:0x4
Incompatible pixel format 'bgra' for codec 'libx264', auto-selecting format
'yuv420p'
[buffer @ 0x1896c60] w:1280 h:720 pixfmt:bgra tb:1/1000000 sar:0/1
sws_param:
[scale @ 0x1901780] w:1280 h:720 fmt:bgra -> w:852 h:480 fmt:yuv420p
flags:0x4
[libx264 @ 0x183fb40] using SAR=1/1
[libx264 @ 0x183fb40] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2
[libx264 @ 0x183fb40] profile High, level 3.1
[libx264 @ 0x183fb40] 264 - core 120 r2164 da19765 - H.264/MPEG-4 AVC codec
- Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1
ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=5 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=0 threads=12 sliced_threads=0 nr=0 decimate=1
interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2
keyint=30 keyint_min=3 scenecut=40 intra_refresh=0 rc=abr mbtree=0
bitrate=3000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
[libx264 @ 0x186be20] using SAR=1/1
[libx264 @ 0x186be20] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2
[libx264 @ 0x186be20] profile High, level 3.1
[libx264 @ 0x186be20] 264 - core 120 r2164 da19765 - H.264/MPEG-4 AVC codec
- Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1
ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=5 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=0 threads=12 sliced_threads=0 nr=0 decimate=1
interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2
keyint=30 keyint_min=3 scenecut=40 intra_refresh=0 rc=abr mbtree=0
bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
Output #0, flv, to 'rtmp://178.63.185.152:1936/live/channel1':
Metadata:
encoder : Lavf53.31.100
Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 1280x720 [SAR
1:1 DAR 16:9], q=-1--1, 3000 kb/s, 1k tbn, 30 tbc
Stream #0:1: Audio: aac ([10][0][0][0] / 0x000A), 44100 Hz, 2 channels,
s16, 96 kb/s
Output #1, flv, to 'rtmp://178.63.185.152:1936/live/channel2':
Metadata:
encoder : Lavf53.31.100
Stream #1:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 852x480 [SAR
1:1 DAR 71:40], q=-1--1, 2000 kb/s, 1k tbn, 30 tbc
Stream #1:1: Audio: adpcm_swf ([1][0][0][0] / 0x0001), 44100 Hz, 2
channels, s16, 352 kb/s
Stream mapping:
Stream #1:0 -> #0:0 (rawvideo -> libx264)
Stream #0:0 -> #0:1 (pcm_s16le -> libfaac)
Stream #1:0 -> #1:0 (rawvideo -> libx264)
Stream #0:0 -> #1:1 (pcm_s16le -> adpcm_swf)
Press [q] to stop, [?] for help
ALSA buffer xrun.31 q=11.0 q=13.0 size= 2501kB time=00:00:03.64
bitrate=5620.4kbits/s dup=162 drop=0
frame= 4419 fps= 30 q=29.0 Lq=28.0 size= 57394kB time=00:02:25.82
bitrate=3224.3kbits/s dup=2430 drop=0
video:95377kB audio:6373kB global headers:0kB muxing overhead -43.593247%
[libx264 @ 0x183fb40] frame I:153 Avg QP:22.20 size: 99281
[libx264 @ 0x183fb40] frame P:4266 Avg QP:27.03 size: 10151
[libx264 @ 0x183fb40] mb I I16..4: 27.8% 14.7% 57.5%
[libx264 @ 0x183fb40] mb P I16..4: 1.5% 1.3% 1.0% P16..4: 16.4% 11.4%
5.6% 0.0% 0.0% skip:62.7%
[libx264 @ 0x183fb40] final ratefactor: 23.03
[libx264 @ 0x183fb40] 8x8 transform intra:24.8% inter:23.1%
[libx264 @ 0x183fb40] coded y,uvDC,uvAC intra: 59.0% 53.1% 29.1% inter:
11.7% 7.8% 0.7%
[libx264 @ 0x183fb40] i16 v,h,dc,p: 69% 19% 8% 3%
[libx264 @ 0x183fb40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 21% 17% 8% 5% 7%
5% 10% 8%
[libx264 @ 0x183fb40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 18% 10% 8% 8% 9%
7% 8% 8%
[libx264 @ 0x183fb40] i8c dc,h,v,p: 53% 21% 19% 7%
[libx264 @ 0x183fb40] Weighted P-Frames: Y:0.5% UV:0.3%
[libx264 @ 0x183fb40] ref P L0: 78.2% 15.1% 6.8% 0.0%
[libx264 @ 0x183fb40] kb/s:3176.96
[libx264 @ 0x186be20] frame I:153 Avg QP:21.38 size: 64168
[libx264 @ 0x186be20] frame P:4266 Avg QP:25.79 size: 6880
[libx264 @ 0x186be20] mb I I16..4: 24.1% 8.5% 67.3%
[libx264 @ 0x186be20] mb P I16..4: 0.4% 0.6% 1.1% P16..4: 18.1% 13.3%
9.2% 0.0% 0.0% skip:57.4%
[libx264 @ 0x186be20] final ratefactor: 21.19
[libx264 @ 0x186be20] 8x8 transform intra:15.6% inter:20.1%
[libx264 @ 0x186be20] coded y,uvDC,uvAC intra: 72.3% 70.7% 47.8% inter:
17.0% 9.9% 1.7%
[libx264 @ 0x186be20] i16 v,h,dc,p: 57% 23% 16% 4%
[libx264 @ 0x186be20] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 19% 19% 7% 5% 6%
5% 10% 9%
[libx264 @ 0x186be20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 17% 11% 8% 8% 9%
7% 9% 8%
[libx264 @ 0x186be20] i8c dc,h,v,p: 48% 24% 19% 9%
[libx264 @ 0x186be20] Weighted P-Frames: Y:0.5% UV:0.3%
[libx264 @ 0x186be20] ref P L0: 79.2% 13.6% 7.2% 0.0%
[libx264 @ 0x186be20] kb/s:2127.33
root at ip-10-248-105-212:~#
-----Ursprüngliche Nachricht-----
Von: ffmpeg-user-bounces at ffmpeg.org [mailto:ffmpeg-user-bounces at ffmpeg.org]
Im Auftrag von Carl Eugen Hoyos
Gesendet: Dienstag, 13. März 2012 13:29
An: ffmpeg-user at ffmpeg.org
Betreff: Re: [FFmpeg-user] VSYNC 1
Sven Dueking <sven <at> nablet.com> writes:
> Is the assumption correct that VSYNC=1 results in dropped and duped
> frames,
Yes
> because ffmpeg cannot handle the incoming data according to the
> specified frame rate in realtime ?
I don't think this is correct.
Frames are duplicated and dropped to match the output stream's fps rate,
this has not necessarily anything to do with realtime. Did you try to reduce
the resolution significantly to test if it is performance issue?
Please provide your command line together with complete, uncut console
output.
Carl Eugen
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
More information about the ffmpeg-user
mailing list