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.

 

Go Back   Doom9's Forum > Video Encoding > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th March 2013, 12:40   #1  |  Link
hrishikesh1990
Registered User
 
Join Date: Jul 2012
Posts: 4
Lagarith and Vfw codecs

Hi,

I was confused over the vfw codec terminology. From what I understand, it is a framework provided by Microsoft for video processing. My aim is to use lagarith for encoding in my application. Since, lagarith is a vfw codec only, does it have any api's that can be used for encoding ?

Thanks.
hrishikesh1990 is offline   Reply With Quote
Old 5th March 2013, 12:50   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,957
Yes, VfW (Video for Windows) is an API created by Microsoft. The idea is that VfW "Codecs" are registered system-wide and applications use the via the VfW API. So, in theory, any VfW-enabled application can use any installed Codec.

BUT: VfW is deprecated and has many issues regarding modern compression formats, e.g. it lacks proper support for B-Frames! Well, it's technology from the early 1990's. It has been superseded by the COM-based DirectShow/DMO long ago. And even DirectShow/DMO is deprecated now, in favor of the new Media Foundation framework...

After all, if your application doesn't need to be able to work with arbitrary user-provided "Codecs" and instead only wants to compress frames with Lagarith, I would recommend to call the Lagarith code directly and avoid platform-specific middle-ware like VfW/DirectShow/MediaFoundation. Lagarith is OpenSource.
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 5th March 2013 at 14:42.
LoRd_MuldeR is offline   Reply With Quote
Old 5th March 2013, 18:00   #3  |  Link
paradoxical
Guest
 
Posts: n/a
Quote:
Originally Posted by LoRd_MuldeR View Post
BUT: VfW is deprecated and has many issues regarding modern compression formats, e.g. it lacks proper support for B-Frames!
And does that actually matter when using Lagarith to encode? No.

Yes, VfW is deprecated but there are still plenty of VfW codecs that are still updated and maintained. For example, Matrox's VfW codecs were last updated April of 2012. That Microsoft deprecated it seems to be essentially meaningless for many people. Just as it was with Microsoft deprecating DirectShow.

Last edited by paradoxical; 5th March 2013 at 18:03.
  Reply With Quote
Old 5th March 2013, 20:37   #4  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,957
Well, if I create a new application nowadays, I would think twice, before I built it on top of a technology that has been deprecated about 15 years ago.

And I would think thrice, before I built it on top of a platform specific technology and thus make my code pretty much un-portable

Furthermore, building an application on top of VfW makes deployment difficult and error-prone, because you need to make sure that the desired VfW Codec is (and remains!) properly registered too.

BTW: I know that ffmpeg/libav can decode Lagarith, but I'm not sure it can encode too. If it does, I would strongly consider building my application on top of libav...
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 5th March 2013 at 20:55.
LoRd_MuldeR is offline   Reply With Quote
Old 5th March 2013, 21:03   #5  |  Link
paradoxical
Guest
 
Posts: n/a
Why? VfW still works just fine and is still widely used in many applications. Especially if all this person wants to do is encode Lagarith with Virtualdub. If the person is on Windows there is basically no reason to not just use the VfW codec.

Also, what exactly is difficult or error prone about it? The VfW API is extremely easy to use. Saying you have to "make sure the codec is properly registered" is no different than with using DirectShow or MediaFoundation.

Last edited by paradoxical; 5th March 2013 at 21:07.
  Reply With Quote
Old 5th March 2013, 21:24   #6  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,957
Quote:
Originally Posted by paradoxical View Post
Why? VfW still works just fine and is still widely used in many applications.
No, it has many flaws. And a lot of things only work, because people have been "creative" in inventing workarounds for the shortcomings of VfW.

Just think about the infamous "packed bitsream" hack

That VfW works okay with simple intra-only Codecs, like Lagarith, isn't really a "pro" argument for building your application on top of an outdated/deprecated framework. Especially with better alternatives available.

If he goes with VfW now and one day he wants to extend his application to work with more "complex" encoders (e.g. B-Frames), things either get really messy or he has to re-write his application...

Quote:
Originally Posted by paradoxical View Post
Especially if all this person wants to do is encode Lagarith with Virtualdub. If the person is on Windows there is basically no reason to not just use the VfW codec.
If one wants to encode with Lagarith in VirtualDub, then there isn't much of a choice, because VirtualDub uses VfW Codecs.

But he is about to create his own software, so it's his choice which API to use. So what is the reason to prefer the deprecated VfW over up-to-date API's?

In case he had a lot of "legacy" code that is based on VfW, things would be different. But that doesn't seem to be the case...

Quote:
Originally Posted by paradoxical View Post
Also, what exactly is difficult or error prone about it?
If the separate installation of the required VfW Codecs fails for whatever reason, or if the user (accidentally) uninstalls the required VfW Codec or if some other application installs an incompatible version of the required VfW Codec or (...), then the application will break.

Quote:
Originally Posted by paradoxical View Post
Saying you have to "make sure the codec is properly registered" is no different than with using DirectShow or MediaFoundation.
Yes, that problem is the same with DirectShow or MediaFoundation.

That's why I'd always prefer to use the encoder library (or alternatively ffmpeg/libav) directly and just deploy the library along with my program executable (or even link it statically).

Especially if my goal is to use one specific encoder, rather than giving the user the choice to select from separately installed Codecs...
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 6th March 2013 at 01:44.
LoRd_MuldeR is offline   Reply With Quote
Old 6th March 2013, 05:38   #7  |  Link
hrishikesh1990
Registered User
 
Join Date: Jul 2012
Posts: 4
Thanks for the replies. The discussion proved helpful.

Quote:
After all, if your application doesn't need to be able to work with arbitrary user-provided "Codecs" and instead only wants to compress frames with Lagarith, I would recommend to call the Lagarith code directly and avoid platform-specific middle-ware like VfW/DirectShow/MediaFoundation. Lagarith is OpenSource.
Yes, I am not concerned with user-provided codecs. I want to encode using Lagarith only and be able to port the code to other platforms like OS X.

Quote:
I know that ffmpeg/libav can decode Lagarith, but I'm not sure it can encode too.
ffmpeg/libav does not have the encoder implementation for lagarith. It can decode only.

So, going by your suggestion and using lagarith code directly, can i find good examples of sample implementation code (like in ffmpeg/libav) ? Where should I start off ?
hrishikesh1990 is offline   Reply With Quote
Old 6th March 2013, 11:44   #8  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,392
Why would you choose Lagarith for anything cross-platform when libav supports both ffv1 and ut enc/dec? There is no Lagarith for OSX or Linux, and making vfw work in wine will make you hate life, let alone working on mobile platforms if you ever want to support them.

UT is nearly equal to Lagarith size, but faster and portable. FFV1 is somewhat smaller but much slower.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 6th March 2013, 12:01   #9  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,957
Quote:
Originally Posted by hrishikesh1990 View Post
Thanks for the replies. The discussion proved helpful.

Yes, I am not concerned with user-provided codecs. I want to encode using Lagarith only and be able to port the code to other platforms like OS X.
Then VfW definitely is not an option. Same for DirectShow or MediaFoundation.

Quote:
Originally Posted by hrishikesh1990 View Post
ffmpeg/libav does not have the encoder implementation for lagarith. It can decode only.
Too bad. As foxyshadis suggested, can't you pick a format with full enc/dec support in ffmpeg/libav?

Even lossless H.264 (encoding via libx264, decoding via ffmpeg/libav) should be considered...

Quote:
Originally Posted by hrishikesh1990 View Post
So, going by your suggestion and using lagarith code directly, can i find good examples of sample implementation code (like in ffmpeg/libav) ? Where should I start off ?
Without having looked at the Lagarith code in detail (I don't even know if it is portable at all!), I would assume that there is some kind of "core" encoder library/class/function plus some kind of "VfW" wrapper/front-end implemented on top of that. Thus this should be your best example on how to call the "core" functions...
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 6th March 2013 at 12:06.
LoRd_MuldeR is offline   Reply With Quote
Old 6th March 2013, 12:05   #10  |  Link
hrishikesh1990
Registered User
 
Join Date: Jul 2012
Posts: 4
Thanks for the suggestion. The problem with ffv1 is the lossless output it produces is not read back by popular video editing softwares like adobe premiere pro, sony vegas pro etc. The same problem comes up with lossless compression done using x264, huffyuv etc (haven't tried UT). With Lagarith, the output video is readable by these softwares.

So, it comes down to obtain a lossless video output which can be edited in video editing softwares.

But as you say, Lagarith does not seem a feasible option. Any pointers ?
hrishikesh1990 is offline   Reply With Quote
Old 6th March 2013, 12:15   #11  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 12,957
Do these "popular video editing softwares" really support Lagarith "out-of-the-box" (I would be surprised) or do they access the Lagarith VfW-Codec through the VfW interface? In that case, you could as well use FFV1 or HuffYUV, as they have VfW Codecs available too. And you would be restricted to Windows, no matter what.

Also: Yes, the "lossless" mode implemented by x264 isn't compatible with some commercial H.264 decoders, as integrated with commercial video editing software, but you could still use "near lossless" encoding. Can you see the difference between "--qp 0" and, let's say, "--crf 12" ???
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.


LoRd_MuldeR is offline   Reply With Quote
Old 6th March 2013, 12:30   #12  |  Link
hrishikesh1990
Registered User
 
Join Date: Jul 2012
Posts: 4
Quote:
Do these "popular video editing softwares" really support Lagarith "out-of-the-box" (I would be surprised) or do they access the Lagarith VfW-Codec through the VfW interface? In that case, you could as well use FFV1 or HuffYUV, as they have VfW Codecs available too. And you would be restricted to Windows, no matter what.
My bad. Didn't check on that. You are correct, they make use of the vfw framework itself. ffv1, huffyuv worked for me when i had the respective vfw codecs installed on my machine.

It should solve the problem then.
hrishikesh1990 is offline   Reply With Quote
Reply

Tags
lagarith

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.