Log in

View Full Version : VC1 pro sdk Encoder speed


nusrat1990
4th July 2011, 15:49
Hello.
I am using VC1 pro SDK encoder.
my app transcodes mpeg2 elementary stream ->vc1 AP.
The app must work in realtime (live broadcasting).
mpeg2 es source is 20 mbit/s 1920x1080
I do mpeg2 decoding using libmpeg2, it's very fast.
Bottleneck in vc1 encoder part, which is at least 3-5 times slower than decoder.
my processor is : i7 920(2.6 ghz)
I tried to decrease encoder definition from 1920x1080 to 960x540. it worked. Decoded frames count equal to encoded, but I need to use 1-pass CBR with bitrate specifying, so decreasing definition is not suitable.
also app uses 4 - 10 threads of encoding. i send to each encoder thread 15-35 frames.
current settings are:

-peakrate 0
-rate 0
-profiletype 2
-bframes 7
-maxkeydist 1000
-vbv 0
-ratecontrol 1
-qp 8
-maxw 1920
-maxh 1080
-complexity 0
-framerate 30

Are there any other settings which can increase speed of encoding?
If here are professionals about vc1 pro encoder sdk, please help me.

Thanks,
Nusrat

Midzuki
4th July 2011, 16:18
I am not a pro, but while Ben Waggoner is not around...

I tried to decrease encoder definition from 1920x1080 to 960x540. it worked. Decoded frames count equal to encoded, but I need to use 1-pass CBR with bitrate specifying, so decreasing definition is not suitable.
:confused:
also app uses 4 - 10 threads of encoding. i send to each encoder thread 15-35 frames.
current settings are:

-peakrate 0
-rate 0
-profiletype 2
-bframes 7
-maxkeydist 1000
-vbv 0
-ratecontrol 1
-qp 8
-maxw 1920
-maxh 1080
-complexity 0
-framerate 30


try -bframes 1 and -maxkeydist 300

kieranrk
4th July 2011, 16:38
The app must work in realtime (live broadcasting).


Are you serious? Using a dead codec for live broadcasting?

Midzuki
4th July 2011, 16:58
Are you serious? Using a dead codec for live broadcasting?

Ooops, I hadn't noticed that detail :o

Anyway :)

-bframes 0 and -maxkeydist 60

nusrat1990
4th July 2011, 21:14
Are you serious? Using a dead codec for live broadcasting?

Are there any other vc1 codec?
I tried intel codec in IPP. Its perfomance is even worse.

Ooops, I hadn't noticed that detail :o

Anyway :)

-bframes 0 and -maxkeydist 60

I tested to set bframes to zero.
But I got error code: -30.
That means only one thing: this setting conflicts with something. very strange.

Why decreasing definition is not suitable.
in 1-pass CBR i specify
-rate 5000
-vbv 2500000
which means half second buffer
Now bitrate will be less than 5000 because i decreased definition, so how can i predict how less it will be?
Performance should be enough to use low buffer.

as i unsderstand from documentation:
-->
lim(real_bitrate) = specified_bitrate;
(vbv -> 0)

I will try to guess, with what "-bframes 0" conflicts.

LoRd_MuldeR
4th July 2011, 21:42
Are there any other vc1 codec?

It seems MainConcept has an VC-1 SDK for sale:
http://www.mainconcept.com/products/sdks/video/vc-1.html

I have no idea about it's quality/performance through...

mp3dom
4th July 2011, 23:17
MainConcept VC-1 implementation is quite poor (at least with previous SDK). Even if PSE/PEP is dead and slow, I think it's still the best implementation available.

If nusrat is obliged to use VC-1 for streaming he can think to go with hardware. There are some solutions from Inlet (hardware board encoders).
more info: http://www.compumodules.com/professional-video/pdf_files/fathom.pdf

kieranrk
5th July 2011, 00:12
Are there any other vc1 codec?
I tried intel codec in IPP. Its perfomance is even worse.


Why don't you use MPEG-4/AVC like everyone else using a post-MPEG-2 codec? No television broadcasts have ever been done in production with VC-1.

Midzuki
5th July 2011, 01:08
Are there any other vc1 codec?
I tried intel codec in IPP. Its perfomance is even worse.

...
I tested to set bframes to zero.
But I got error code: -30.
That means only one thing: this setting conflicts with something. very strange.

...

I will try to guess, with what "-bframes 0" conflicts.

TinTime built a mod of AVS2ASF which fixed that problem and others as well. Download it (source-code included) from:

http://www.mediafire.com/file/ztl0tdilg4n/AVS2ASF.zip

or from:

http://forum.videohelp.com/threads/331600-ffmpeg-output-2gb-limit-Is-there-one-ffmpeg-stops-encoding-h264-2gb?p=2067819&viewfull=1#post2067819

BUT, in the end, I have to agree with both kieranrk and mp3dom :) VC-1 was poisoned by Microsoft's incurable "ASF-mania", this is the reason why it sux pig time :D

nusrat1990
5th July 2011, 08:17
TinTime built a mod of AVS2ASF which fixed that problem and others as well. Download it (source-code included) from:

http://www.mediafire.com/file/ztl0tdilg4n/AVS2ASF.zip

or from:

http://forum.videohelp.com/threads/331600-ffmpeg-output-2gb-limit-Is-there-one-ffmpeg-stops-encoding-h264-2gb?p=2067819&viewfull=1#post2067819

BUT, in the end, I have to agree with both kieranrk and mp3dom :) VC-1 was poisoned by Microsoft's incurable "ASF-mania", this is the reason why it sux pig time :D
Midzuki, :thanks:
Yes, in original vc1 sample encoder has error. bdeltaqp conflicts with bframes.
But performance is still bad.
Hardware solution is not flexible,
there is no udp based input and output.
Also my app should work like pipeline, no file using allowed.
MainConcept is slow.
I have to use 1-pass VBR with definition decreasing...
Thanks to everybody for help.
Project completed.

P.S. it's not my decision of using vc1. It's actually not television broadcasting, it's rather comp to comp broadcasting.

benwaggoner
3rd August 2011, 23:12
Hmmm. A few questions


How many milliseconds of latency can you live with?
What OS are you running on? Would it be feasible to run on Windows 7?
Have you looked at licensing the VC-1 Encoder SDK Enterprise version instead? That's the one with all the IPTV broadcast tuning


The Pro SDK is relatively old code at this point. The encoder in Windows 7 has substantial performance improvemence (8-way threaded, and 40% faster when using B-frames). So if you're trying to do a live HD broadcast of WMV, that would do the job better and more easily. Just make sure to set the PropertyBucket parameters optimally.

Alternatively the Enterprise version of the SDK is the one with the good live encoding tuning, including Lookahead Rate Control and Dynamic Complexity. That's what gets used for all the Silverlight HD live sports broadcasting (Olympics, Wimbleton, and so on). Inlet's Spinnaker VC-1 live encoder runs this library on a bunch of Intel cores.

Your settings could also use some tuning

1 B-frame is generally optimal for film/video content. Using 7 will hurt quality and probably performance as well.
Don't set BdeltaQP. If you leave the parameter unset, you'll get the dynamic mode which is almost always best.
Why QP=8?