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. |
5th March 2013, 12:40 | #1 | Link |
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. |
5th March 2013, 12:50 | #2 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
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.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 5th March 2013 at 14:42. |
5th March 2013, 18:00 | #3 | Link | |
Guest
Posts: n/a
|
Quote:
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. |
|
5th March 2013, 20:37 | #4 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
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...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 5th March 2013 at 20:55. |
5th March 2013, 21:03 | #5 | Link |
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. |
5th March 2013, 21:24 | #6 | Link | |||
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
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:
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... 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:
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...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 6th March 2013 at 01:44. |
|||
6th March 2013, 05:38 | #7 | Link | ||
Registered User
Join Date: Jul 2012
Posts: 4
|
Thanks for the replies. The discussion proved helpful.
Quote:
Quote:
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 ? |
||
6th March 2013, 11:44 | #8 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
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. |
6th March 2013, 12:01 | #9 | Link | ||
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
Quote:
Even lossless H.264 (encoding via libx264, decoding via ffmpeg/libav) should be considered... 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...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 6th March 2013 at 12:06. |
||
6th March 2013, 12:05 | #10 | Link |
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 ? |
6th March 2013, 12:15 | #11 | Link |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
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" ???
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ |
6th March 2013, 12:30 | #12 | Link | |
Registered User
Join Date: Jul 2012
Posts: 4
|
Quote:
It should solve the problem then. |
|
Tags |
lagarith |
Thread Tools | Search this Thread |
Display Modes | |
|
|