VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 23 of 23
Thread
  1. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    I know it's possible to encode video from various codecs to .h264 with Quick Sync.
    My questions is, is it possible to use Quick Sync hardware to decode h264 video and save the output to an intermediate format like Cineform, ProRes, etc.?

    If it is possible could someone explain how to do it?

    Thanx in advance...
    Quote Quote  
  2. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Yes, there is e.g. DGDecIM as native AviSynth plugin to use the QuickSync video decoder. It uses an indexer application which helps the plugin DLL to seek in the video stream. A small registration fee is required (like for DGDecNV). — doom9 thread (abandoned) / Donand Graft's forum
    Quote Quote  
  3. ffmpeg can be used to perform QSV accelerated decoding (indirectly or directly).
    Quote Quote  
  4. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    DGDecIM seems to be stuck in Beta and I wouldn't pay for Beta software.

    How can I use ffmpeg to perform QSV accelerated decoding? Just recently started using ffmpeg, so I'm not very familiar with it's capabilities yet.
    Quote Quote  
  5. Originally Posted by ziggy1971 View Post
    DGDecIM seems to be stuck in Beta and I wouldn't pay for Beta software.

    How can I use ffmpeg to perform QSV accelerated decoding? Just recently started using ffmpeg, so I'm not very familiar with it's capabilities yet.

    You need to have ffmpeg build supporting QSV, you need explicitly call QSV decoder before your input file, it may be necessary to explicitly load hardware assisted decoder trough -load_plugin (for sure it need to be used with HW encoder), side to this it may be necessary to add before '-i' (input) from https://www.ffmpeg.org/ffmpeg-all.html#Advanced-Video-options '-hwaccel:v qsv --hwaccel_device:v hw_any' however read about qsv HW decoding limitations:

    qsv

    Use the Intel QuickSync Video acceleration for video transcoding.

    Unlike most other values, this option does not enable accelerated decoding (that is used automatically whenever a qsv decoder is selected), but accelerated transcoding, without copying the frames into the system memory.

    For it to work, both the decoder and the encoder must support QSV acceleration and no filters must be used.

    This option has no effect if the selected hwaccel is not available or not supported by the chosen decoder.

    Note that most acceleration methods are intended for playback and will not be faster than software decoding on modern CPUs. Additionally, ffmpeg will usually need to copy the decoded frames from the GPU memory into the system memory, resulting in further performance loss. This option is thus mainly useful for testing.
    Quote Quote  
  6. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    Thanks for the info. How is the quality of the decoded video with QSV compared to the original or other decoders? If the quality would be worse than using the ffms2.dll, then I'd rather not use it.

    Currently, I use something like this:
    Code:
    SetMTMode(5, 10)
    FFVideoSource("H:\My Videos - Originals\Season 2\S02-E03 - WIDMND.mkv")
    I've tried different values other than 10, (CPU is a 4930K, 6-cores, 12-threads) but it seems that it's the one that gives the highest fps, which is around 65-95 fps for 1080p video
    My CPU usage is less than 25%

    My source video is on one HDD and the destination is on another, one drive is reading while the other writes.

    Any suggestions on speeding this up? Threading, different decoder, etc.
    Quote Quote  
  7. Originally Posted by ziggy1971 View Post
    Thanks for the info. How is the quality of the decoded video with QSV compared to the original or other decoders? If the quality would be worse than using the ffms2.dll, then I'd rather not use it.

    Currently, I use something like this:
    Code:
    SetMTMode(5, 10)
    FFVideoSource("H:\My Videos - Originals\Season 2\S02-E03 - WIDMND.mkv")
    I've tried different values other than 10, (CPU is a 4930K, 6-cores, 12-threads) but it seems that it's the one that gives the highest fps, which is around 65-95 fps for 1080p video
    My CPU usage is less than 25%

    My source video is on one HDD and the destination is on another, one drive is reading while the other writes.

    Any suggestions on speeding this up? Threading, different decoder, etc.




    How are you measuring the 65-95 fps ? That can't be decoding only (measured with something like avsmeter), because you'd typically get maybe 150-300 FPS for decoding even with vanilla avisynth with libav (ffms2 or lsmash for 1080p) on a quad core. It must be encoding to prores or cineform (and how, exactly what are you doing) etc... or another bottleneck. Possibly decoding isn't a bottleneck in your actual process. Also using MT avisynth and something like ffmpeg, you must add distributor() to the script . But you shouldn't even need MT avisynth for just decoding (vanilla avisynth on a quad core should get 150-300FPS)

    Technically, all decoders should give the same output (quality wise) , but in reality, there can be issues such as image corruption, mixed up frames. Even with ffms2 (higher risk when using MT and threads not equal to 1), and especially with PAFF AVC transport streams

    QS won't work for you in ffmpeg , because you are encoding to prores or cineform (but not ENcoding cineform in ffmpeg). QS in ffmpeg requires both encoder/decoder support, but another way to use QS as decoder is directshowsource with lav filters configured to use QS, and/or graphstudio with lav configured to use QS as decoder
    Quote Quote  
  8. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    Measuring the fps is, as I mentioned above, was by watching the progress of VirtualDub, yeah, I know, not the best.

    However, upon calculating elapsed time of the last 10 videos I've done (all between 52 & 61 minutes each), I'm actually getting between 84-98 fps. (Yeah, I keep records of encodes for various reasons like testing different codecs, settings, quality, time, etc.)

    I had avisynth.dll 2.6.0.3 and AVSMeter 2.2.1 wouldn't run. So, I simply copied avisynth.dll 2.6.0.5 to C:\Windows\SysWOW64 folder (nothing in the C:\Windows\System32 folder)

    This is a screenshot of AVSMeter 2.2.1 of one video:
    Click image for larger version

Name:	Untitled.png
Views:	225
Size:	26.3 KB
ID:	38868

    Obviously, a very different average fps.
    Yes, I am encoding to CineForm on the Medium quality setting for editing/cutting clips, etc.

    Any suggestions to speed it up?
    Quote Quote  
  9. I think the bottleneck is the cineform encoding. Decoding isn't the bottleneck, and you don't even need to use MT

    I would run multiple simultaneous instances of vdub, maybe 3-4 since your CPU usage was 25% if your storage setup is fast enough
    Quote Quote  
  10. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    I was thinking of running multiple simultaneous instances of vdub, but I'm not that familiar with the capabilities of the various parts (ffms2.dll, VirtualDub, CineForm, etc.) I don't know how many instances of each can be run at the same time without having any conflict issues.

    As soon as I get a chance, I'll give it a run and see how the numbers differ from running individual files.

    As for the MT, I commented out that line and ran the test again, this time the average fps jumped to 368.2 fps, so I guess you're right about not needing it for this type of file. (I think the video is vc1, not h/x264, I don't know how to tell the difference in an .mkv file)
    Quote Quote  
  11. Originally Posted by ziggy1971 View Post
    Measuring the fps is, as I mentioned above, was by watching the progress of VirtualDub
    In VirtualDub try File -> Run Video Analysis Pass. That will read the source as fast as possible (assuming you're not filtering in VirtualDub). Turn off display of input/output videos. Very similar to AVSMeter.
    Quote Quote  
  12. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    Using this source:
    Code:
    FFVideoSource("H:\My Videos - Originals\Season 2\S02-E03 - WIDMND.mkv")
    AVSMeter 2.2.1 = 360.46 fps
    VirtualDub 1.8.8 = 367.46 fps (only opened the script, under Video -> Fast recompress, and ran the test, no codecs selected/changed)
    Quote Quote  
  13. So cineform is your bottleneck.
    Quote Quote  
  14. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    I guess so. Any suggestions on speeding CineForm up? Another codec perhaps? What do you use jagabo?
    Quote Quote  
  15. These days I usually use UT Video Codec for intermediate files. I don't know how the speed and compression compare to Cineform or Prores.
    Quote Quote  
  16. If you want to speed it up, use several instances. You can effectively get 4x speed if 1 instance uses ~25% CPU usage if you have no other bottlenecks like storage I/O.

    Why are you doing this in the first place ? (well I guess if it's VC-1 that could be a reason, you can use mediainfo to check), but the most common reason is if some extra processing steps were used, otherwise many people choose to edit original sources natively. Several streams/layers of 1080p AVC is very managable on modern hardware with decent software NLE. Cineform is known for it's DEcoding speed not encoding speed. Same with UT video. The timeline performance in another application like a NLE. That's why it's know as an "editing codec"
    Quote Quote  
  17. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    Which setting do you use with UT Video Codec. I see there are several different variations.

    I'm thinking that maybe I should stick with CineForm, even though I may not be able to speed it up in VirtualDub.

    One of the benefits is when I'm done editing the video in Sony Vegas 11, it only renders or recompresses the parts that were modified, ie. fades, or any other video effects. The sections/clips that have no changes don't get recompressed, just copied over. For instance, simply cutting out commercials in an hour long video can be rendered to a new clip in about 5 minutes (that's at 1080p @ 23.976 fps), ready for x264 encoding. Obviously, more edits/effects = longer render times, but it does save time where it needs to.

    I know I could frameserve the video directly out of Vegas to MeGui, but that means my PC is occupied for the duration of the x264 encode.
    Alternately, I render the intermediate file to another drive and allow another PC to do the x264 encoding.

    Sure, trimming the clips could be done with Avisynth as well as many of the effects added, but writing those scripts can be daunting.

    If you could get me the setting you use with the UT Video Codec, I'll run some tests using the same videos I did with CineForm so I can compare them.

    Nonetheless, thanks for helping out.
    Quote Quote  
  18. Normally for UT you would use the same settings as the source. (e.g if the source was YUV 4:2:0, you would use one of the YUV 4:2:0 variants of UT)

    UT will be slower than cineform, both encode and decode. It's a truly mathematically lossless codec. Cineform isn't. There is quality loss with cineform, however minor. Filesizes will also be larger for UT since it's lossless

    But vegas doesn't handle YUV variants of UT video as YUV (ie. it's not lossless in vegas due to colorspace conversions), but it does smart render UT RGB if the settings are matched correctly
    Quote Quote  
  19. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Why are you doing this in the first place ?
    Well, I'm on disability, have no formal schooling or training so I thought this would be a good way to learn something new. A person can only sit and do nothing (or watch TV) for so long; I gotta keep my mind busy.

    Not sure if I can post this, but here goes (let me know if it's not allowed and I'll remove the link):
    https://www.youtube.com/watch?v=1mQ-Xpf8Wgs

    My apologies if my questions seem tedious or ill-informed, the web is full of misleading information. So, to better understand, one must ask, right?

    Thanx again...
    Quote Quote  
  20. Member
    Join Date
    Jan 2007
    Location
    Canada
    Search Comp PM
    Here is what mediainfo displays for this video:

    Video
    ID: 1
    Format: AVC
    Format/Info: Advanced Video Codec
    Format profile: High@L4.1
    Format settings, CABAC: Yes
    Format settings, ReFrames: 4 frames
    Codec ID V_MPEG4/ISO/AVC
    Duration: 52mn 37s
    Bit rate mode: Variable
    Bit rate: 29.3 Mbps
    Maximum bit rate: 35.0 Mbps
    Width: 1 920 pixels
    Height: 1 080 pixels
    Display aspect ratio: 16:9
    Frame rate mode: Constant
    Frame rate: 23.976 fps
    Color space: YUV
    Chroma subsampling: 4:2:0
    Bit depth: 8 bits
    Scan type: Progressive
    Bits/(Pixel*Frame): 0.589
    Stream size: 10.8 GiB (93%)
    Language: English
    Default: No
    Forced: No
    Quote Quote  
  21. I meant what were your reasons using cineform (or prores, or whatever) as an intermediate, since it's an extra few steps

    vegas should open that source file up as-is , so depending on what you were actually doing in vegas (what types of maniuplations and edits, what the project particulars were) , I'd assess whether or not the extra time / hdd space of using cineform (or other intermediate) is actually worth it

    Some editors (i'm referring to people here, not software) hate editing long GOP, regardless , and will automatically encode everything to some I frame intermediate if it wasn't already . On very large projects, lots of long GOP footage can sometimes cause problems and cause some software to "act up"
    Quote Quote  
  22. I'm usually not concerned about encoding speed when I'm using UT Video Codec because I'm using it with very slow AviSynth script.
    Quote Quote  
  23. Originally Posted by ziggy1971 View Post
    DGDecIM seems to be stuck in Beta and I wouldn't pay for Beta software.
    I'll change the filename to version 1.0.0. Then you'll be able to use it.
    Quote Quote  



Similar Threads