Hi folks,
We use ffmpeg to encode files for online streaming. But since I want a really good image quality, I'm facing a huge problem, the video is jerky while streaming, even if it's 100% buffered, but if we play the file with vlc from the computer all is good.
My goal is to have the best image quality as possible (pretty close/or same as the source), but staying around 15megs/minute ratio, and that the streaming is fluid and not using up the computer resources of who is watching it.
Actually I use this command line :
The medium_firstpass preset contains :
ffmpeg -i SOURCE_FILE -deinterlace -s 960x540 -aspect 16:9 -acodec libfaac -ac 2 -ar 44100 -ab 128k -vcodec libx264 -vpre medium_firstpass -vb 2200k -pass 1 -f rawvideo -y /dev/null
ffmpeg -i SOURCE_FILE -deinterlace -s 960x540 -aspect 16:9 -acodec libfaac -ac 2 -ar 44100 -ab 128k -vcodec libx264 -vpre medium -vb 2200k -pass 2 -f mp4 -y OUTPUT.mp4
MP4Box -inter 500 OUTPUT.mp4
And the medium preset contains :coder=1
flags=+loop
cmp=+chroma
partitions=-parti8x8-parti4x4-partp8x8-partb8x8
me_method=dia
subq=2
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=1
qcomp=0.6
qmin=10
qmax=51
qdiff=4
bf=3
refs=1
directpred=1
trellis=0
flags2=+bpyramid-mixed_refs+wpred-dct8x8+fastpskip
wpredp=2
Your help will be very appreciated, I'll watch this thread often to answer your questions rapidly.coder=1
flags=+loop
cmp=+chroma
partitions=+parti8x8+parti4x4+partp8x8+partb8x8
me_method=hex
subq=7
me_range=16
g=250
keyint_min=25
sc_threshold=40
i_qfactor=0.71
b_strategy=1
qcomp=0.6
qmin=10
qmax=51
qdiff=4
bf=3
refs=3
directpred=1
trellis=1
flags2=+bpyramid+mixed_refs+wpred+dct8x8+fastpskip
wpredp=2
Best regards,
Raphael
+ Reply to Thread
Results 1 to 14 of 14
-
-
-
Hi intracube
Basically the website where the videos are streamed is a big european website, so there's thousand of difference users that come to watch the videos. All videos are encoded on debian servers, running x264 & ffmpeg last version.
The flash player we use to stream the videos, is a one we developed, and all mp4 files are stored on the big cdn of limelight networks.
We started to have issues when we have increased the video quality. If I drop the -vb to 1000 instead of 2200, obviously it gets better, but the image quality is terrible.
On freenode on #x264, somebody told me to remove the b-frames, which did not helped. I also disabled CABAC, which did not helped to.
Now I'm going to try to encode the h264 files from x264 instead of ffmpeg, but if you guys have ideas, I would really appreciate it before I jump by the window ! -
Try something like:
x264.exe --preset=veryfast --crf 18 --ref 3 --bframes 2 --sar 1:1 --output %1.mp4 %1 -
I'll have to play with it, I'm getting coloured snow instead of the video (see attachment)
I used this command :
x264 --preset=veryfast --ref 3 --bframes 2 --sar 1:1 --output output.mp4 input.mpg --input-res 960x540
raw [info]: 960x540p 1:1 @ 25/1 fps (cfr)
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Slow SlowCTZ
x264 [info]: profile High, level 3.1
x264 [info]: frame I:1 Avg QP:35.00 size:312251
x264 [info]: frame P:56 Avg QP:35.00 size:318964
x264 [info]: mb I I16..4: 23.1% 37.3% 39.6%
x264 [info]: mb P I16..4: 28.4% 39.6% 28.4% P16..4: 0.1% 0.5% 2.9% 0.0% 0.0% skip: 0.0%
x264 [info]: 8x8 transform intra:41.0% inter:19.9%
x264 [info]: coded y,uvDC,uvAC intra: 100.0% 100.0% 100.0% inter: 100.0% 100.0% 100.0%
x264 [info]: i16 v,h,dc,p: 0% 0% 95% 4%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 3% 4% 64% 4% 6% 4% 4% 4% 5%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 6% 5% 40% 6% 13% 7% 8% 6% 8%
x264 [info]: i8c dc,h,v,p: 92% 0% 0% 8%
x264 [info]: Weighted P-Frames: Y:1.8% UV:1.8%
x264 [info]: ref P L0: 39.3% 30.5% 30.2%
x264 [info]: kb/s:63769.33
encoded 57 frames, 44.53 fps, 63771.79 kb/s
-
Have you tried other Flash players like Flowplayer or JW Player? If you get smooth playback with them, it would suggest your in house developed Flash player needs looking at. But if you get the same stuttering, it could be an encoding issue.
What web browser are you using, and have you tried any others? Is Flash up to date? System spec, etc? -
Hi Intracube,
I'm thinking to have the developers look into the player now after the 50 tests I did... My observation is that the cpu usage is an issue. Before with that player, at 1000k rate it was not rushing the computer, but obviously it was so low quality.
The issue seem to happen on any flash version and browser. -
Just did a test by reducing the resolution of the -s variable at the same quality and the cpu dropped by 30%.
So my question is, do I have a potential solution to follow or it's just simply normal ? -
I've just done a test encode with ffmpeg using the same bitrate, x264 preset, resolution, and played it back with the JW Player without any stuttering. My CPU usage stayed around 45%. This was with Firefox 7.0.1, Flash 11.0.1.152 and an ancient (and low spec) Nvidia graphics card on Linux.
By doing that you're dropping the resolution of the video which would be a workaround. The real issue is figuring out why your flash player is thrashing the CPU. -
ok thank you so much intracube. If you want I can give you the link of many test I did, but you have to know it's 18plus content, if you want to see send me a prive message.
Thanks again
Similar Threads
-
Anyone Can Help to Convert This Preset to FFmpeg Command Line?
By raymng in forum Video ConversionReplies: 2Last Post: 26th Feb 2012, 12:11 -
ffmpeg generate audio/add to video help please, command line
By surfmonkee in forum LinuxReplies: 3Last Post: 11th Sep 2011, 16:17 -
ffmpeg tga to x264 command line ?
By krohm in forum Video ConversionReplies: 71Last Post: 6th Jul 2010, 02:01 -
H264: Are there other h264 (AVCHD/VC-1) encoding command-line/CLI tools ??
By vhelp in forum Newbie / General discussionsReplies: 12Last Post: 16th Feb 2008, 01:20 -
Definitive command line for ffmpeg conversion to ipod from tivo?
By orev in forum Video ConversionReplies: 1Last Post: 16th Jan 2008, 13:29