in

andy vt's tools & blog

automating lazy

This Blog

Syndication

andy vt's blog

QSTranscode

QSTranscode:

Command line utility that can be used to transcode video files using Intel QuickSync for
decoding/encoding and FFMPEG for container and audio support. Edit files are supported in
EDL and XML format for editing while transcoding.

Special thanks to Hendrik Leppkes & Eric Gur for their efforts on LAV Filters and the
Intel QuickSync Decoder and for opening the code for these projects. They demonstrated
many of the concepts leveraged here as well as providing source code.

Usage: qstranscode.exe -i "InputFile" -o "OutputFile" -w width -h height [options]
Where [options] can be:
    [-h264|-mpeg2|-jpeg] - output video codec
    [-aac|-ac3|-mp3] - output audio codec, if missing audio will be copied without transcoding
    [-f frameRate] - output video frame rate
    [-b bitRate] - encoded video bit rate (Kbits per second), valid for H.264, MPEG2 and MVC encoders
    [-u 1|4|7] - target usage: quality (1), balanced (4) or speed (7); valid for H.264, MPEG2 and MVC encoders. Default is balanced
    [-q quality] - quality parameter for JPEG encoder; in range [1,100], 100 is the best quality
    [-l numSlices] - number of slices for encoder; default value 0
    [-w] - destination picture width, if both width & height are unspecified detected intput size will be used, can be used with height or by itself where output height will be calculated
    [-h] - destination picture height, if both width & height are unspecified detected intput size will be used, can be used with width or by itself where output width will be calculated
    [-async] - depth of asynchronous pipeline. Default value 25.
    [-sw|-hw|-hw_d3d11] - SDK implementation to use: t-hw - platform-specific on default display adapter (default),t-hw_d3d11 - platform-specific via d3d11t-sw - software.
    [-join] - join session with other session(s), by default sessions are not joined
    [-priority] - use priority for join sessions. 0 - Low, 1 - Normal, 2 - High. Normal by default
    [-n ] - Number of frames to limit transcoding
    [-angle 180] - enables 180 degrees picture rotation user module before encoding
    [-opencl] - uses implementation of rotation plugin (enabled with -angle option) through Intel(R) OpenCL
    [-deinterlace] - forces VPP to deinterlace input stream, if unset interlaced video will be deinterlaced if detected
    [-ab bitRate] - encoded audio bit rate (Kbits per second), defaults to 64000
    [-ac channels] - number of audio channels to mix to, defaults to 2 use 0 to specify "auto"
    [-at tracknumber] - audio track to transcode, when unset the "best" audio track is used
    [-e EditsFile] - path to EDL or XML file with cut points

1.0.0.0
- Initial release

bin

Published Mar 18 2013, 06:15 PM by babgvant
Filed under:

Comments

 

JohnGalt said:

Excellent tool!

A couple of suggestions that would make this absolutely PERFECT:

1. Allow Specifying "would like" audio (i.e. if there is a TrueHD, DTS/MA I would like it included. Then specify required 5.1 track (i.e. if there is multi-channel audio, always create ac-3 track) and then required track (i.e. always create aac 2.0). The reason for this is that perfect compatibility can be achieved with m2ts or m4v if you have h264 video and 1 aac 2.0 track, 1 ac-3 5.1 track if possible, and then anything else someone might want. Makes a killer format.

2. Give us the ability to specify rules for WHEN transcode will happen. For instance if I give it a file with h264 video that is 4.1 profile and non-interlaced, I want it to just copy the video quickly instead of transcoding and introducing noise. If it's greater than 4.1 or is interlaced, then I want to transcode to that. If it's something other than h264 video, I always want it to transcode.  Again this allows you to create a ruleset that the program will automatically convert to a 100% standard format that all modern players will play properly.

Just some thoughts!

Also, I can't see it in the options, but is it possible to just tell it to transcode and leave a .h264 file that I could then manually pack with ffmpeg?

March 19, 2013 5:43 AM
 

babgvant said:

If you don't specify an audio codec the "best" track is copied to the output file. That said, the purpose for this app is primarily for transcoding for mobile, high quality transcodes are better done using a software based tool like Handbrake.

As for the other points, I'm not sure that this logic belongs in the transcoder. I plan to build a GUI around this at some point some of those items would make sense to build in there for configuring the command line for this tool.

Thanks

March 19, 2013 6:00 AM
 

JohnGalt said:

Ok, well a way to specify multiple audio tracks, or a way to just call to rip the h264 would be great.

I honestly don't see much difference between handbreak on high  quality and intel on high quality so this would be hugely more time efficient.

March 19, 2013 1:21 PM
 

babgvant said:

Copying all of the audio tracks wouldn't be hard, nor would copying a stream and also transcoding it. Would that work?

That said it's possible to do what you're looking for currently, transcode the video, copy audio, then use a 2nd step to remux the video with whatever audio tracks you want (MKVMerge can do this).

March 19, 2013 1:42 PM
 

stodly said:

This is a VERY exciting tool. A quick test gave me about a 4x improvement over my Handbrake profile (encoding a WTV on a 2600S).

However, I am not successful playing back on any Apple devices. There is a constant video stutter. Any known limitations or options I should try?

March 20, 2013 12:16 PM
 

babgvant said:

WTV doesn't always work properly yet. I haven't had a chance to figure out why.

Can you see if a different container based transcode works on iOS (I don't have anything to test that with).

March 20, 2013 12:25 PM
 

emveepee said:

Thanks for making this available, it is working much better than I hoped with an HD4000

I notice it loads a libmfx dll that I have installed on startup  Does it matter which one, I have v 1.4

Martin

March 21, 2013 4:33 PM
 

babgvant said:

libmfx.dll is the MSDK (software interface to QuickSync), as long as it's recent it should work fine.

March 21, 2013 5:17 PM
 

mrk said:

My .mkv video doesn't work. What can I do?

April 4, 2013 8:32 AM
 

babgvant said:

If the MKV contains VC-1 video, wait for the next release. Otherwise I'll probably need a small sample.

April 4, 2013 9:07 AM
 

mrk said:

I've send you a sample.

April 4, 2013 12:47 PM
@2008 andy vt
Powered by Community Server (Non-Commercial Edition), by Telligent Systems