Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
Hardware accelerated decoders
Hello all, been a while since I've last been here.
I've been out of the loop for a while now, and I was wondering what was recommended for decoding Blu-ray disks. Right now my bottleneck is the source, since I'm only seeing about ~20% CPU load on my machine (Core i7, I'm not expecting to see 100% but more like 60 - 80%). I'm using FFVideoSource to open up my m2ts files, since I can't figure out how to get it to work otherwise. On that note, what's the recommended way of actually opening .m2ts files so I can process them? DSS times out, and I have ffdshow tryouts installed. Anyhow, any help is appreciated!
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame. |
|
|
|
|
|
#2 | Link | |
|
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
I have been using DGDevNV for quite a while and I'm quite happy with it so far. I get about 60-120 fps depending on the source which is fast enough for my C2Q at 3 GHz encoding to x264. |
|
|
|
|
|
|
#3 | Link |
|
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
I may try just going with the MT version of Avisynth. I don't really have that complex of a script that I use for processing my videos.
In essence it's just: Code:
Source(...) Crop(...) Resize(...) MDegrain2(...)
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame. |
|
|
|
|
|
#4 | Link |
|
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
You don't need the MT version of Avisynth. The multithreaded ffms2 will be sufficient, especially with a simple script.
Edit: OK, I don't know how slow MDegrain2 is so it might be worth testing various scenarios. |
|
|
|
|
|
#5 | Link |
|
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
I double checked, and I have the multithreaded version of ffms2.
Still getting only ~20% CPU usage during encoding though. This is my script: Code:
src = FFVideoSource("video.m2ts", cachefile="video.m2ts.ffindex").AssumeFPS("ntsc_film")
src = src.Spline36Resize(1280, 720, 0, 128, 0, -136)
super = src.MSuper(pel=4)
bvec2 = super.MANalyse(isb=true, delta=2, blksize=8, overlap=4)
bvec1 = super.MANalyse(isb=true, delta=1, blksize=8, overlap=4)
fvec1 = super.MANalyse(isb=false, delta=1, blksize=8, overlap=4)
fvec2 = super.MANalyse(isb=false, delta=2, blksize=8, overlap=4)
src.MDegrain2(super, bvec1, fvec1, bvec2, fvec2)
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame. |
|
|
|
|
|
#6 | Link | |
|
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
|
|
|
|
|
|
|
#7 | Link |
|
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,407
|
You want to try Avisynth-MT.
After that, you want to drop pel from 4 to 2. (pel=4 is so much slower, and so much of a waste.) After that, you want to up blksize from 8 to 16 (and overlap from 4 to 8). At that point, you'll start seeing "reasonable" speeds.
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
|
|
|
|
|
#8 | Link |
|
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
How would you use SetMTMode with MVtools? I tried using the way suggested in the documentation, but I get
garbage for the video output.
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame. |
|
|
|
|
|
#9 | Link |
|
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,407
|
Code:
SetMTmode(5,6) # mode=5 at first (to not break [most] source filters)
setmemorymax(1000)
LoadPlugin("MVTools2.dll")
LoadPlugin("ffms2.dll")
Import("ffms2.avsi")
ffvideosource("source.mkv")
changefps(last,last,true) # cache a few frames of input - dont ask, just do. ;-)
setmtmode(2) # after source loading, switch to mode=2
o = last
blks = 16 # sufficient for 720p / a-must for 1080p
pels = 2 # or even 1 when in a hurry ...
sup1 = o.MSuper(pel=pels,sharp=2)
bvec1 = sup1.MAnalyse( isb=true, delta=1, blksize=blks, overlap=blks/2 )
fvec1 = sup1.MAnalyse( isb=false,delta=1, blksize=blks, overlap=blks/2 )
bvec2 = sup1.MAnalyse( isb=true, delta=2, blksize=blks, overlap=blks/2 )
fvec2 = sup1.MAnalyse( isb=false,delta=2, blksize=blks, overlap=blks/2 )
o.mdegrain2(sup1,fvec1,bvec1,fvec2,bvec2)
return(last)
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
|
|
|
|
|
#12 | Link |
|
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,407
|
I've encountered a few instances where a script like
setmtmode(5) ffvideosource - or - DGsource/DGMultiSource setmtmode(2) filters() actually would run *very* slow. Inserting the changefps line solved the problem. Hence, this seems like a "does never hurt, but may help tremendously" tweak.
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
|
|
|
|
|
#13 | Link |
|
Registered User
Join Date: Nov 2009
Posts: 2,375
|
Can I omit setmtmode(5)?
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread |
|
|
|
|
|
#14 | Link |
|
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,407
|
Of course you can. Nobody forces you to use multithreading.
(If you omit setmtmode(5), the script will run single-threaded.)
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
|
|
|
|
|
#15 | Link |
|
Registered User
Join Date: Nov 2009
Posts: 2,375
|
sh** I thought setmtmode(5) was to force single threading (?)
I lived in ignorance!
__________________
i7-4790K@Stock::GTX 1070] AviSynth+ filters and mods on GitHub + Discussion thread Last edited by Dogway; 22nd January 2011 at 22:55. |
|
|
|
|
|
#16 | Link |
|
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,407
|
Yes.
1) To make multithreading via SetMTmode functionning, SetMTmode must be used before any video clip is loaded. 2) Most source filters are not compatible with mutlithreading. 1) + 2) =>implies=> mode(5,threads) -> sourcefilter -> mode(2) -> filterchain
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
|
|
|
|
|
#18 | Link | |
|
warpsharpened
Join Date: Feb 2007
Posts: 787
|
Quote:
If you're thinking about using MT avisynth though it's likely that your source filter will not be your bottleneck and with ffms2 which with some common formats is already threaded if you use the ffmpeg-mt compiled version. |
|
|
|
|
|
|
#19 | Link | |
|
x264aholic
Join Date: Jul 2007
Location: New York
Posts: 1,752
|
Quote:
And what better way than through a filter that does essentially a very fast nop ![]() Edit: On an unrelated note, it's been about 3 years since I've done any big encoding. I just re-encoded the Blu-ray version of Serenity to 720p. It came out 400 MB smaller and looks better than my older DVD rip
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame. Last edited by Sagekilla; 23rd January 2011 at 20:21. |
|
|
|
|
|
|
#20 | Link |
|
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,442
|
The [linear=]true in the call to ChangeFPS is to ensure that frame requests to the preceding filter arrive in linear order, since seeking in a source filter can often be slow (depending on format).
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|