[streaming] Need some help with I-Frames and X264

Ferenc Deak ferenc.deak at adactus.no
Wed May 5 14:21:02 CEST 2010


Hi all,

I want to stream a live source to three different outputs using VLC: 1 
stream should be 100kbit, another one 300, and the last one 500. These 
result streams are later segmented using an application on every I-frame 
after 10 seconds (ie. the new TS segment file should start on the first 
Iframe after 10 seconds have passed). Now, comes a huge problem: in 
these three streams the I-frames are not placed at a regular interval, 
and even their number is not the same (although I thought that if I set 
up the keyint, min-keyint and fps parameters in a proper way I should 
get the same number of I-frames regardless the quality). I have streamed 
the setup below for one hour and for the 100kbit channel I've got 807 
I-frames, for the 300 I've got 961 I-frames, and for the 500kbit I've 
got 1071 I-frames. Another weird thing is that if I modify the audio 
parameters, the number of I-frames in the video stream is changing.

I would like your help to hint me a set-up for the x264 encoder which 
produces a constant number of I-frames for all three outputs, preserving 
the bitrate difference and audio quality (and if this is not possible, 
then please let me know, I'll look for other ways solving this issue). I 
thought that if the relation between keyint, min-keyint and fps is the 
same for all streams then the generated keyframe number will be the same 
too, but obviously I was wrong :( )

setup 4_zebra output 
#duplicate{dst="transcode{vcodec=h264,threads=4,venc=x264{aud,level=13,profile=baseline,merange=16,chroma-me,me=umh,subme=7,ipratio=1.4,bframes=0,ref=3,mixed-refs,no-cabac,direct=auto,deblock=0:0,nf,qpmin=16,qpmax=51,qcomp=0.6,partitions=slow,ratetol=0.05,scenecut=40,keyint=45,min-keyint=45,no-fast-pskip,vbv-init=0.9,vbv-maxrate=768,vbv-bufsize=2000},width=320,height=240,vb=275000,fps=15,acodec=mp4a,samplerate=22050,ab=24000,channels=1}:duplicate{dst=std{access=udp,mux=ts,dst=127.0.0.1:20002}}",dst="transcode{vcodec=h264,threads=4,venc=x264{aud,level=13,profile=baseline,merange=16,chroma-me,me=umh,subme=7,ipratio=1.4,bframes=0,ref=3,mixed-refs,no-cabac,direct=auto,deblock=0:0,nf,qpmin=16,qpmax=51,qcomp=0.6,partitions=slow,ratetol=0.05,scenecut=40,keyint=75,min-keyint=75,no-fast-pskip,vbv-init=0.9,vbv-maxrate=768,vbv-bufsize=2000},width=320,height=240,vb=440000,fps=25,acodec=mp4a,samplerate=32000,ab=64000,channels=2}:duplicate{dst=std{access=udp,mux=ts,dst=127.0.0.1:20001}}",dst="transcode{vcodec=h264,threads=4,venc=x264{aud,level=13,profile=baseline,merange=16,chroma-me,me=umh,subme=7,ipratio=1.4,bframes=0,ref=3,mixed-refs,no-cabac,direct=auto,deblock=0:0,nf,qpmin=16,qpmax=51,qcomp=0.6,partitions=slow,ratetol=0.05,scenecut=40,keyint=36,min-keyint=36,no-fast-pskip,vbv-init=0.9,vbv-maxrate=768,vbv-bufsize=2000},width=320,height=240,vb=80000,fps=12,acodec=mp4a,samplerate=22050,ab=20000,channels=1}:duplicate{dst=std{access=udp,mux=ts,dst=127.0.0.1:20000}}",dst="transcode{vcodec=mp4v,threads=1,venc=ffmpeg{keyint=100,hq=simple,trellis=1,rc-buffer-size=245760,pre-me=1},width=320,height=240,vb=250000,fps=15,acodec=mp4a,samplerate=44100,ab=96000,channels=2}:rtp{mp4a-latm=1,dst=127.0.0.1,port-audio=20000,port-video=20002,sdp=file:///usr/local/movies/diactus/restricted/preview_4.sdp}"}

and a short output of the iframe counter application:
You can see that the 100 kbit stream has the same number of i-frames in 
almost two minutes (12:00:01.65 --> 12:01:57.33) then the 300 has in one 
minute ten seconds (12:00:01.50 --> 12:01:10.62) and the 500 has in 1 
minute (12:00:00.75 --> 12:01:01.13)

video 	iframe for 33_100 at 	12:00:01.65 	  segment_time:59895.0736 	
	video 	iframe for 33_300 at 	12:00:01.50 	  segment_time:59895.0820 	
	
	video 	iframe for 33_500 at 	12:00:00.75 	  segment_time:59895.0820 	
video 	iframe for 33_100 at 	12:00:10.28 	  segment_time:59907.0736 	
	video 	iframe for 33_300 at 	12:00:04.72 	  segment_time:59901.0820 	
	
	video 	iframe for 33_500 at 	12:00:04.10 	  segment_time:59901.0820 	
video 	iframe for 33_100 at 	12:00:22.13 	  segment_time:59919.0736 	
	video 	iframe for 33_300 at 	12:00:07.65 	  segment_time:59904.0153 	
	
	video 	iframe for 33_500 at 	12:00:07.15 	  segment_time:59904.0820 	
video 	iframe for 33_100 at 	12:00:28.98 	  segment_time:59925.0736 	
	video 	iframe for 33_300 at 	12:00:10.72 	  segment_time:59907.0820 	
	
	video 	iframe for 33_500 at 	12:00:10.90 	  segment_time:59907.0820 	
video 	iframe for 33_100 at 	12:00:31.98 	  segment_time:59928.0736 	
	video 	iframe for 33_300 at 	12:00:16.55 	  segment_time:59913.0820 	
	
	video 	iframe for 33_500 at 	12:00:16.11 	  segment_time:59913.0820 	
video 	iframe for 33_100 at 	12:00:34.11 	  segment_time:59931.0736 	
	video 	iframe for 33_300 at 	12:00:19.11 	  segment_time:59916.0820 	
	
	video 	iframe for 33_500 at 	12:00:19.17 	  segment_time:59916.0820 	
video 	iframe for 33_100 at 	12:00:40.93 	  segment_time:59937.0736 	
	video 	iframe for 33_300 at 	12:00:22.63 	  segment_time:59919.0820 	
	
	video 	iframe for 33_500 at 	12:00:22.19 	  segment_time:59919.0820 	
video 	iframe for 33_100 at 	12:00:43.79 	  segment_time:59940.0736 	
	video 	iframe for 33_300 at 	12:00:34.97 	  segment_time:59928.0820 	
	
	video 	iframe for 33_500 at 	12:00:28.80 	  segment_time:59925.0820 	
video 	iframe for 33_100 at 	12:00:54.59 	  segment_time:59946.0736 	
	video 	iframe for 33_300 at 	12:00:37.61 	  segment_time:59934.0153 	
	
	video 	iframe for 33_500 at 	12:00:31.10 	  segment_time:59928.0820 	
video 	iframe for 33_100 at 	12:00:55.12 	  segment_time:59952.0736 	
	video 	iframe for 33_300 at 	12:00:40.59 	  segment_time:59937.0820 	
	
	video 	iframe for 33_500 at 	12:00:34.11 	  segment_time:59931.0820 	
video 	iframe for 33_100 at 	12:00:58.13 	  segment_time:59955.0736 	
	video 	iframe for 33_300 at 	12:00:43.57 	  segment_time:59940.0820 	
	
	video 	iframe for 33_500 at 	12:00:40.14 	  segment_time:59937.0820 	
video 	iframe for 33_100 at 	12:01:04.98 	  segment_time:59961.0736 	
	video 	iframe for 33_300 at 	12:00:54.71 	  segment_time:59946.0153 	
	
	video 	iframe for 33_500 at 	12:00:43.11 	  segment_time:59940.0820 	
video 	iframe for 33_100 at 	12:01:10.84 	  segment_time:59967.0736 	
	video 	iframe for 33_300 at 	12:00:55.59 	  segment_time:59952.0820 	
	
	video 	iframe for 33_500 at 	12:00:46.20 	  segment_time:59943.0820 	
video 	iframe for 33_100 at 	12:01:13.90 	  segment_time:59970.0736 	
	video 	iframe for 33_300 at 	12:00:58.63 	  segment_time:59955.0820 	
	
	video 	iframe for 33_500 at 	12:00:53.77 	  segment_time:59946.0820 	
video 	iframe for 33_100 at 	12:01:16.81 	  segment_time:59973.0736 	
	video 	iframe for 33_300 at 	12:01:01.58 	  segment_time:59958.0820 	
	
	video 	iframe for 33_500 at 	12:00:55.23 	  segment_time:59952.0820 	
video 	iframe for 33_100 at 	12:01:57.33 	  segment_time:60009.0736 	
	video 	iframe for 33_300 at 	12:01:07.59 	  segment_time:59964.0820 	
	
	video 	iframe for 33_500 at 	12:00:58.17 	  segment_time:59955.0820 	
video 	iframe for 33_100 at 	12:01:57.33 	  segment_time:60014.0736 	
	video 	iframe for 33_300 at 	12:01:10.62 	  segment_time:59967.0820 	
	
	video 	iframe for 33_500 at 	12:01:01.13 	  segment_time:59958.0820 	



Thanks a lot,
frc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/streaming/attachments/20100505/599064f4/attachment.htm>


More information about the streaming mailing list