Lightworks for Linux: The developer's story | Opensource.com

Lightworks for Linux: The developer's story

Posted 17 Oct 2012 by 

Rating: 
(6 votes)
open lightbulbs
Image by : 

opensource.com

submit to reddit

Lightworks for Linux is approaching its public testing phase. Lead Developer Rob Fearnside answers questions from Red Shark News about how it got to this stage.

Editor's note: Lightworks is a high-end non-linear video editor.

When did you decide to make the majority of Lightworks' code OS independent and what was your approach to doing this?

The Lightworks codebase is quite large—close to a million lines of code altogether—and some of it has been in existence for nearly twenty years. When we started the move to make it cross-platform 18 months ago, we were faced with a number of challenges, including:

  • How do you rewrite that much code in a sensible timeframe
  • How do you keep shipping Windows builds whilst the work is underway?

Our solution was to avoid rewriting the Windows-specific code at all (it was, after all, tried, tested and optimized). Instead, we decided to move it to a new operating system dependent layer which we engineered to have an OS independent interface. Once this was complete, we were then able to begin work on a Linux implementation of that same layer. In essence, the Lightworks code is now split in two—the OS independent code (eg. editing, play-engine, etc) which uses the OS dependent code (eg. file access, threading, etc).

What percentage of the code is now OS independent?

The OS independent code accounts for about 97% of the total codebase. The bulk of the work in porting to Linux was actually in re-engineering the existing code, not in writing the Linux-specific layer.

What was the hardest thing about porting to Linux?

In order to get the very best performance, Lightworks' Windows layer uses Direct3D for all the video scaling, effects, and colour-space conversion. Linux of course doesn't have Direct3D, so we had to reimplement all the Linux GPU specific code using OpenGL. The multi-threaded nature of the Lightworks software made some of the OpenGL support difficult to write. In particular, updating video/playback images from a non-ui thread was a real challenge, and for a while I wasn't sure it was even possible, but after much head scratching, we found a solution that worked.

How happy are you now with the results?

The initial goal with the Linux version was to try to make it as similar to the Windows version as possible. Now, if you run the two versions side by side, it's extremely difficult to tell them apart, so in that sense, I'm very pleased with the results. Additionally, because we went through the process of splitting the code into OS dependent and independent pieces, we've ended up with a cleaner, more maintainable codebase which will benefit all of our future development across all platforms.

Originally posted on Red Shark News. Reposted with permission.

submit to reddit

13 Comments

CD

I stopped reading about 20 seconds in. Lightworks. Great. What is it???

Vote up!
0
Vote down!
-2
Unidentified
Vote up!
2
Vote down!
0
CD

Seriously? I'm going to research something just so an article makes sense to me? I don't think so! :) :) :)

Vote up!
0
Vote down!
0
Victor Westmann

Movie editor. Ok. I agree with CD. It should be explained in the article in the 1st place.

Vote up!
0
Vote down!
0
Algy

If I may add, this is a major issue with open source in general. How many times does one unpack the source and there is no synopsis of any sort?

Vote up!
0
Vote down!
0
Ryan

Seems like lightworks is not even open source yet (was promised to be open source soon), so I don't know what this story is doing here at this point.

Vote up!
0
Vote down!
0
mo

Software doesn't have to be open-source to aid and abet the transition from Windoze to other platforms. The most common successful countermeasure to adopting open platforms is " doesn't exist on " and that ends the conversation. By providing powerful, world-class software on as well as Windoze, the list of show-stopper complaints gets just that much shorter. And as indicated in the article, the developers get the added benefit of revisiting old design decisions which no longer require the same compromises as when made a decade ago. The net result is that more software that pays the bills is available on more platforms, and that makes those platforms more able to pay the bills and hence get adopted.
Having been through these wars since the late 70s, I have seen "the better is the enemy of the good" snatch defeat from the jaws of victory more than once and understanding the real dynamics of adoption is critical. If Lightworks ends up being open-sourced as a result, so much the better, but this disentangling of the code base is a necessary first step to supporting multiple platforms and they are to be commended for taking it. Many firms are still not so enlightened.

Vote up!
4
Vote down!
0
Jen Wike Huger
Open Sourcerer

Lightworks is a high-end non-linear video editor. We apologize for not including more information about that before, please read here for further insight from Michael Larabel at Phoronix: http://www.phoronix.com/scan.php?page=news_item&px=MTEyMjE.

Vote up!
0
Vote down!
0
hoijui

i kind of agree with Ryan, that it is hard to see the relevance for open source here.
sure, it is beneficial for linux to have more software, even if it is not open source, and it is also good for open source devs to get tips for how to port their software to other OSs, but that is just too loose of a connection to open source, really.
i could post a story of how windows powered MRI machine helped keeping open source software dev X alive, which is working on a software that runs on linux, which is open source too!
so i can get free advertisement for windows on opensource.com.
at best, this story belongs to a linux related news site, and even then i would prefer if the softwares name was left out.

Vote up!
0
Vote down!
0
Aleve Sicofante

Wow. What a bunch of narrow minded fellows around here.

First of all, Lightworks IS open source. What they sell as closed are some proprietary codecs they just aren't in a position to open themselves (because they don't own them and they are industry standards). Maybe not all the code has been opensourced yet (I'm not sure), but the aim is certainly to do that, excepto for the aforementioned codecs, which you don't need for editing videos in a number of formats.

I hope the guys at Lightworks don't even read the comments here. They are not representative of what people in the open source arena think of Lightworks. It's probably the biggest thing to happen to opensource in the area of digital content creation ever (far more important than the very important Blender phenomenon).

I thank the team very much for creating Lightworks for Linux and I want to remind them there will be opensource zealots along the way, all the time, moaning and groaning. Just ignore them and go ahead. There are several orders of magnitude more people out there wishing you well, compared to this little group of grumpy zealots.

Vote up!
0
Vote down!
0
mo

it if wasn't clear from my previous note, i am delighted to see something as professionally credible as Lightworks available on Linux in *any* form. The fact it is indeed open-source as much as it can be given the complex and litigious nature of the codec mechanics is just that much more impressive.

Vote up!
0
Vote down!
0
hoijui

i can't find a single bad word about Lightworks, its devs, or its move to support linux in any of the comments. i am also sure that none of the commenters thinks any bad of any of these three.
the problems are solely with the article.
at least two readers (commenters) got confused about the relevance to open source, which kind of should be there, as this is a site about open source. the article does not mention whether the software is or is not open source, or how much, or when, possibly, ...
that is maybe just as important as the description of what the software is.
the article suggests that it is a commercial software, and in todays world, knowing that a software is commercial and there is no mention about it being open source or not, means it is not. if it is, then .. again, this is a mistake in the article.
just because they do something good (going to support linux), does not mean that everything related to this move (like an article about it) automatically turns gold and untouchable. just because someone says something bad about an article, does not mean he is entirely against everything mentioned in the article.
should we stop reporting lightworks bugs, because they are moving to linux now, and reporting bugs is an insult?

just to make this clear.. i also do not hate the guy who wrote the article. it is normal to make mistakes, and i appreciate it that the info about the software was added. the open source principle relies on critique.
my bug report is: please add info about the open source status of the software to the article.

Vote up!
0
Vote down!
0
Ryan

Wow, I wasn't really expecting so many folks to need to jump in on my simple observation that to date Lightworks does not appear to be open source. I link to a source code repository and a lisence document might have ended my confusion. Instead, even the folks jumping on me for my simple comment are confused and divided whether lightworks is somehow open source except for the codecs, or whether it is completely closed now, and soon will become open, or whether it is closed, but runs on linux so it is positively adding to an open source ecosystem. I would suggest that this confusion just makes plain that taking an article out of context (indeed from a company newsletter apparently) and dropping it on opensource.com when there is no link made to opensource at all in the article is a mistake.

Vote up!
0
Vote down!
0

Rob is a lead programmer for Lightworks. He joined the company in 1993 where he spent over a decade working on a number of areas including the user-interface and video effects. He then moved to Quantel where he helped create their new effects architecture before eventually returning to Lightworks in 2010.

Reader favorite