News:

--

Main Menu

Building for Windows

Started by nemach, March 25, 2020, 01:24:39 PM

Previous topic - Next topic

nemach

Hi - newbie question...

I'd like to do some scripted video editing with python and am missing the keyframe finding feature in the tinypy implementation mentioned here:
https://avidemux.org/smif/index.php/topic,18446.0.html

As a C/C++ dev, I'm quite happy to have a go at extending the functionality, but I'd like a few pointers for Windows development. Is there an up-to-date Wiki guide on how to build from scratch on Windows? I've tried to follow the mingw plug-in build instructions from the old wiki (https://www.avidemux.org/admWiki/doku.php?id=build:devel_2.6) but am getting link problems. Are the 2.7.5 Windows lib files compatible with mingw?

TBH, I'd prefer to use MSVC++ anyway - can a newer version than v.6 be used?

Apologies if this is all documented elsewhere - if so, please just point me in the right direction! If it really is pointless trying to build on Windows with newer versions, then I guess I can persevere with cross-compiling from a Ubuntu VM.

Neil

eumagga0x2a

Quote from: nemach on March 25, 2020, 01:24:39 PM
Is there an up-to-date Wiki guide on how to build from scratch on Windows?

No, unfortunately not. I can't help either because I didn't manage to build Avidemux with Visual Studio 2017 ~ a year ago and didn't have time and impetus to give it a new try with Visual Studio 2019.

QuoteI've tried to follow the mingw plug-in build instructions from the old wiki (https://www.avidemux.org/admWiki/doku.php?id=build:devel_2.6) but am getting link problems. Are the 2.7.5 Windows lib files compatible with mingw?

No, you must use VC++. As long as you just work on plugins, https://www.avidemux.org/admWiki/doku.php?id=build:devel_2.6_msvc + https://avidemux.org/smif/index.php/topic,18849.msg87315.html#msg87315 should work, but you probably need a debug build, not possible with the official VC++ Avidemux nightlies.

QuoteTBH, I'd prefer to use MSVC++ anyway - can a newer version than v.6 be used?

Current nightlies are built with MSVC++ 2019.

Debugging doesn't work with MingW builds. Currently, the only choice is either Linux (gcc, maybe also clang) or Windows with MSVC++.

nemach

Great tips - thanks for your help.

After I worked out that the lib formats of my installed version of avidemux looked wrong for a mingw64 build, I installed the win64 version (as opposed vsWin64), and at least I've managed to build and link the test plugin now.

I'll have a look at the links you sent and see if I've got time to get things working. Is there any way to see the nightly build config just to copy it locally? It's a shame it's not in a public CI pipeline (or is it?!).

Thanks again.
Neil

eumagga0x2a

Quote from: nemach on March 25, 2020, 02:07:11 PM
Is there any way to see the nightly build config just to copy it locally?

Regarding native builds on Windows, I fear, I really can't help. You might try to contact Mean.

Regarding cross-builds, I never attempted to look into installer, but apart from that everything is pretty well documented with a few outdated bits as MXE doesn't provide a current enough version of x265 and this lib should be built and installed manually. If you have questions, please ask, I'll try to answer if I am able to.

Adding an ability to seek to keyframes to tinyPy scripting is definitely wanted and on my todo list. Would require a few simple modifications to the editor and the script engine.

nemach

Let me start getting the build environment going, and then I'll see if I can work out where changes are needed. Maybe I'll come back if I need to verify I'm looking in the right areas.

eumagga0x2a

Does it mean that you would like to implement the necessary changes yourself? Else I have a patch to add getCurrentPts(), getPrevKFramePts(), getNextKFramePts() methods to pyEditor and seekKeyFrame(int) to pyAdm class as well as to optimize ADM_Composer::seekKeyFrame(int) ready for commit. Just say how you would prefer to proceed.

nemach

Well I was planning to have a go at implementing I it myself, but I don't want to reinvent the wheel. So if you already have a patch that would be great. But is this a complete solution or just part of it? If it's complete, why isn't it on master?

eumagga0x2a

#7
I really don't want to keep you from starting to contribute to the project, it was more a mid-air collision as once you reminded me about that topic I started immediately (and I was using a computer where I can't work on the stuff in Avidemux I was actually trying to accomplish).

Quote from: nemach on March 26, 2020, 06:20:14 AM
But is this a complete solution or just part of it?

It depends on your needs, probably incomplete. The changes would allow to get the PTS of the currently displayed (nextFrame() in pyEditor doesn't update the currently displayed picture), to query the PTS of the previous or next keyframe and to seek to an integer number of keyframes prior or past the current position. What else would be needed?

QuoteIf it's complete, why isn't it on master?

I just didn't want to go ahead without asking. I started once you reminded me about that old intention, there was no action on my part before.

eumagga0x2a

Err, I see that Editor().nextFrame() does update the current PTS, just doesn't refresh the preview.

eumagga0x2a

Seeking to keyframes and e.g. saving the picture as a JPEG image works with CLI too, so this is not tied to the GUI.

eumagga0x2a

Pushed as [editor] Optimize ADM_Composer::seekKeyFrame, [editor] Expose the method to query the next keyframe pts to scripting and [tinyPy] Extend API.

It would be a major contribution to Avidemux if you could figure out and document the steps necessary to create a functional MSVC++ native build environment similar to what is available for cross-building.

nemach

That's great - thanks for pushing your updates!

I'm working on the MSVC 2019 build and making some progress now. Will report on how things develop...