Intel QSV H.264 codec for AVFoundation and DirectShow

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Tiemo
Posts: 31
Joined: Wed Feb 21, 2007 3:37 pm
Location: Kassel, Germany
Contact:

Intel QSV H.264 codec for AVFoundation and DirectShow

Post by Tiemo » Mon Jul 04, 2016 10:44 am

Hello,
I made some tests with LC 8.1.0 dp1 to find a video codec solution, as a replacement for QuickTime which fits for both platforms windows and OS X.
I am looking for the most standardized state of the art codec to get a maximum of compatibility on both platforms, so I think H.264 is the right choice.
My special requirement is, that I have to step thru the video frame by frame controlled by LC.
My sorenson squeeze compressor offers 4 different H.264 codecs: "Intel QSV H.264", "MainConcept H.264", "Sorenson MPEG-4", "x264"
My LC tests showed me, that I need to set a keyframe every single frame to be able to step thru the video framebased (at least with DirectShow). This option do only the intel QSV and the x264 codec offer.
The x264 codec is a opensource codec and as far as I understand it is not preinstalled on any system and at least on my Mac a x264 video can't be played (perhaps there is a chance to manually install it, what I would like to avoid for my customers)
So up to now it seems to me that only the intel QSV H.264 is left of my choices. It should be supported from Windows Vista on and from OS X 10.8 on.

Has anybody experiences in this field of codecs, other experiences or tipps for or would negate some of my conclusions?

Thanks
Tiemo

okk
Posts: 176
Joined: Wed Feb 04, 2015 11:37 am

Re: Intel QSV H.264 codec for AVFoundation and DirectShow

Post by okk » Wed Nov 09, 2016 8:10 pm

Hi, I cannot answer your question in a very direct way, but here some experiences: H.264 codec in a mp4 wrapper is considered to be pretty universal and in most cases it doesn't require to install additional codec. With x264 I am not sure, but since I use VLC player anyway, I never run into that issue.

For encoding MPEG Streamclip has been considered a great free tool on MacOs. I assume it uses Apples AVFoundations implementation of the H.264 standard for encoding. MPEG Streamclip doesn't allow you to manually set keyframes though.

But using a key-frame for each frame defeats the purpose of the h264 compression since the idea of interframe compression is to save a full frame (aka keyframe) just now and then (like every second) and only save the actual changes between the individual frames located between those keyframes. Setting keyframe interval to 1 makes your video files unnecessary large. In this case an intraframe compression might be more effective.

Code controlled playback of videoclips on windows has been poor, to say the least. (I used LC 8.1.1 on Windows 10) For example after I use the

Code: Select all

set the currentTime of player to number
the video image is frozen for a short while. Maybe it has to do with keyframes, so that it only starts playing the video properly when it reaches the next keyframe. Maybe it is also worthwhile to consider platform specific encodings.

Best
Oliver

Tiemo
Posts: 31
Joined: Wed Feb 21, 2007 3:37 pm
Location: Kassel, Germany
Contact:

Re: Intel QSV H.264 codec for AVFoundation and DirectShow

Post by Tiemo » Fri Nov 11, 2016 5:21 pm

Hi Oliver,
thanks for your reply.
My experiences the last years showed, that there are big differences in compatibility within different codecs, coding the same "standard" like H.264. E.g. I used a Sorenson codec H.264 for an android project and it showed that not all android standard video player can playback my videos, others do. I now decided to go with the "most standard" Intel QSV H.264 codec with a 1 keyframe per 1 frame setting and tested it successfully on Windows 10 and OS X 10.11 This was the only codec for me with which I could realize the stepping frame by frame thru a video back and forward, which is essentially for my app, even if it is against a good compression factor.
I also have experienced weired behavior trying to step thru a video as far as I didn't used the correct timescale per platform. The timescale on OS X AVFoundation is 600, on Windows DirectShow 10.000.000. This could also be a factor in your expierences, as well as the codec and coding parameters (1 keyframe by 1 frame).

Tiemo

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Intel QSV H.264 codec for AVFoundation and DirectShow

Post by Klaus » Fri Nov 11, 2016 5:47 pm

Hi Tiemo,

I usually use "Handbrake" with the "standard" H.264 (x.264) codec.
These videos run fine on Mac and Windows (and in LC!) and even on my LG "Smart TV",
which are ususally quite picky in this respect.

And, as a nice sideeffect, "Handbrake" produces the smallest possible filesize:
< 600 MB for a 90 minute video in 640*360 pixels resolution.
There I cannot mecker! :D

Please feel free to contact me off-forum, if you have some questions!
klaus AT major-k.de


Best

Klaus

Tiemo
Posts: 31
Joined: Wed Feb 21, 2007 3:37 pm
Location: Kassel, Germany
Contact:

Re: Intel QSV H.264 codec for AVFoundation and DirectShow

Post by Tiemo » Fri Nov 11, 2016 6:03 pm

Hi Klaus,
right now, I am quite happy with the Intel codec, but good to have another choice.
Have a nice WE
Tiemo

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Intel QSV H.264 codec for AVFoundation and DirectShow

Post by Klaus » Fri Nov 11, 2016 6:26 pm

Hi Tiemo,

Okie Dokie, have a nice weekend, too! :D

Hint:
Always check the "timescale" anew, even on a Mac it can be different from the "usual" 600!


Best

Klaus

Tiemo
Posts: 31
Joined: Wed Feb 21, 2007 3:37 pm
Location: Kassel, Germany
Contact:

Re: Intel QSV H.264 codec for AVFoundation and DirectShow

Post by Tiemo » Fri Nov 11, 2016 6:28 pm

what does the timescale on OS X depend from?
has there been a change from any OS X on? or are there other dependencies?
Tiemo

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Intel QSV H.264 codec for AVFoundation and DirectShow

Post by Klaus » Fri Nov 11, 2016 6:39 pm

"the timescale" is combination of a property of the movie file itself and the underlying OS multimedia routines.
But I never searched for a how and why. 8)

Post Reply

Return to “Multimedia”