SubtitleEdit / subtitleedit

the subtitle editor :)
http://www.nikse.dk/SubtitleEdit/Help
GNU General Public License v3.0
7.53k stars 851 forks source link

Port to MacOS #81

Open ivantronics opened 10 years ago

ivantronics commented 10 years ago

Plain and simple. This piece of software is extraordinaire and it would be lovely to use it without parallels on macs. I have no skill in programming whatsoever, but I believe it won't be that hard, since macos is a unix based system. Please, make it happen

camez commented 9 years ago

Agreed.

I've been using other subtitling programs on my Mac, but recently took my old pc out of the basement, wiped it clean, and loaded just enough back on so that I could use SE on it. It's not even connected to the internet because it's running Windows XP and is way too vulnerable to malware now, so I transfer files back and forth from a flash drive.

That's how much I love SE--having an old, slow, clunky computer take up space in my work area, just so I can load the one program!

chenlung commented 9 years ago

Sorry to bump, but I would like this as well.

I've tried a number of subtitle editors on Mac, and it's hard to find a good one.

niksedk commented 8 years ago

Sorry, I don't have Mac... so if you've a mac lying around that you don't use do email it to me :)

DotTheI commented 8 years ago

Desperately need SE for OS X as well. Even paid one.

jdpurcell commented 8 years ago

I looked into it a bit; I'll leave some notes in case another developer wants to try.

To aid with debugging, it's greatly helpful to get the solution working in Xamarin Studio. To do that, I had to edit SubtitleEdit.csproj and libse.csproj to remove the pre-build events and any NuGet related items. For both projects you'll need an AssemblyInfo.cs file on the Properties folder - I copied the ones over from my Windows environment but perhaps empty files would even work. As for the libraries that came from NuGet, I just commented out the affected code but it would probably be just as easy to re-reference the libraries. After that everything builds fine.

First I tried to get VLC working. Unfortunately Mono on OS X is 32-bit, so you'll need a 32-bit version of VLC since it's referenced via library instead of the command line. The 32-bit version of VLC is no longer maintained so you'll be stuck with version 2.0.10 from February 2014. I changed the player code a bit to force it to use LibVlcMono, added a dllmap entry to the app.config to point it to libvlc.5.dylib inside the VLC bundle, and changed the audio extraction code to point to the VLC executable inside the bundle. I was able to open a video and extract the audio (the visualizer seemed to work fine). Playback only worked for audio; the video area was just black.

Then I tried mplayer. mplayer builds are no longer maintained at all on OS X, so again you have to find a few year old build - I used "MPlayer OSX Extended". I changed the player code to point to the mplayer executable inside the bundle (didn't try audio extraction since I already did it with VLC). It was able to open up a video, but the video showed up in its own mplayer window. SubtitleEdit's player was unable to control anything (e.g. the play button and seeking did nothing).

After that I gave up. I won't put any more time into it because I have no interest in using Subtitle Edit on OS X. Actually I have no interest in using OS X at all :smile:. I bought a MacBook Pro to run Windows just because all the Windows laptops felt cheap and I really wanted a 16:10 display. So anyway if someone else wants to try, maybe it would be possible, but probably not easy. WinForms on OS X is quite terrible anyway, it's slow and buggy.

DotTheI commented 8 years ago

@jdpurcell Thank you for your efforts!!

This application really needs to have an OS X version. There's nothing as good as Subtitle Edit.

niksedk commented 8 years ago

As jdpurcell wrote (much good info) WinForms on OSX is quite terrible, so I've started looking at Xamarin + Cocoa + 64-bit, which would make a nice native experience for OSX users incl. latest VLC media player, but the downside is that all UI code needs to be rewritten. For a 64-bit version all System.Drawing.* code (like bitmaps) will need to be 'fixed' as the Xamarin 64-bit frameworks don't support that.

It's not easy as pie, but I think that OSX will get a "light" version of Subtitle Edit some time next year :)

cellx commented 7 years ago

Maybe the #Electron coding is a good solution for that?

tillkolter commented 6 years ago

@niksedk Almost two years since your last comment, has there been any progress or did you decide to abandon the idea?

niksedk commented 6 years ago

I was hoping that .net core 2 would include system.drawing and make it easy, but still too much is missing. I've uploaded a Mac beta: https://github.com/SubtitleEdit/subtitleedit-mac - bit Ive not had much feedback or help. Also, this version does not share code with the Windows version, but is more a hacked version. I guess the goal is to make libse cross platform with some 2D gfx lib like ImageSharp - but I don't have much time and I don't know anything about Mac.

chenlung commented 6 years ago

Hi @niksedk

I tried it out, and I think with a few fixes (e.g. crashes) it could serve as a 'cut-down' editor for Mac (a 'better-than-nothing' solution) in the meantime; it might even encourage others to come forward. I'm not a developer, but I could provide some feedback.

niksedk commented 6 years ago

Also, @oxguy3 write a osx launcher using Wine - https://github.com/oxguy3/subtitle-edit-launcher

DotTheI commented 6 years ago

I didn't know that macOS version exists. It doesn't have translation option, which I use SE for predominantly, unlike Windows version, but I'll keep it as a default subtitle editor. The Wine launcher doesn't work for me, giving an error. Until it's fixed I'll continue running SE with help of CrossOver (and that's very inconvenient) and keep hoping that someday a native macOS SE version will be out.

alangfp commented 6 years ago

Any news on a native version of SE for MacOS?? Please, I'd even pay for it, I guess many people would

rmanne commented 6 years ago

After that I gave up. I won't put any more time into it

Funny that you didn't bother just trying SE instead of the media players. SE actually makes decent progress. It's super slow to start up (took ~15-30s). It gets pretty far, but crashes when you try to select your OCR auto-correct/spell-checking dictionary. It slowly uses more and more memory until it crashes (maybe it's being killed by the OS?). I tried both 5.10.0 and 5.8.1, but they both crash here.

Note for people that want to try anyways: DO NOT USE HOMEBREW TO INSTALL MONO. brew installs mono without 32-bit compatibility, and mono's 64-bit doesn't support libgdiplus, which appears to be necessary for running SE (and probably most UI applications). Use the official page: http://www.mono-project.com/download/stable/#download-mac

Also, @oxguy3 write a osx launcher using Wine - https://github.com/oxguy3/subtitle-edit-launcher

This didn't work for me at all: no window is created, no error, nothing. Also, not sure why it's even attempting to use wine when the SE binary supports mono. mono got me much further.

EDIT: Ok so apparently you don't need an auto-correction / spell checking dictionary selected to run SE? screen shot 2018-04-02 at 22 11 00 It works! Here are the steps I took:

  1. Install Mono
  2. Install Tesseract (with brew): brew install tesseract
  3. Download and unpack SE (download the portable installer with linux support via mono)
  4. Use mono to run SE: /Library/Frameworks/Mono.framework/Versions/5.10.0/bin/mono --arch=32 SubtitleEdit.exe
francwalter commented 6 years ago

Does all features run with this? Sounds great! I was using always Aegisub, which is working, but since long (2014) not anymore developed (??) and anyway not so functional as SE, which I use on Windows. Will try this now on my MacBook Pro from mid 2009 (OS 10.11.6) and report :) Thanks meanwhile.

rmanne commented 6 years ago

As I described above, if you attempt to use auto-corrections, it doesn't work. But the core OCR portion and editor UI work just fine.

francwalter commented 6 years ago

Not working on my MacBook (mid 2009 with 10.11.6) at least with Mono 5.10.1 I run: /Library/Frameworks/Mono.framework/Versions/5.10.1/bin/mono --arch=32 /Applications/SE356/SubtitleEdit.exe and nothing happens. In the error console I just can read that error (repeated 3 times directly after the command): 30.04.18 11:03:20,340 launchservicesd[93]: SecTaskLoadEntitlements failed error=22

But anyway, I have VMware Fusion on my Mac and can run SE with Windows XP there. No worries and thank anyway.

EDIT: "... with Windows XP..." where I just ran into the next errors...

DotTheI commented 6 years ago

If the obstacle on the way to develop a fully functional SE version for macOS is the absence of a proper computer, then why not launch a donation campaign for that specific project so that Nikolaj can buy a MacBook laptop?

I realize that anyone may donate to Nikolaj via http://www.nikse.dk/Donate/, but I think if there was a dedicated progress bar (say, to reach $1000) that would show anyone the amount of money left to reach the goal, that would motivate everyone who wants a native SE application for macOS.

chenlung commented 6 years ago

I would donate to that, though I'm not sure what kind of machine will be needed (also, a redesigned Mac Pro might be announced later this year) and what OS versions could be supported (I'm using 10.11.6).

NickZ commented 5 years ago

@niksedk I took a look at the .net core 3 preview, and it appears that most of the issues with system.drawing are resolved. Only a handful of functions remain unimplemented (less than .3%). See my portability analysis here: ApiPortAnalysis.zip

niksedk commented 5 years ago

@NickZ: That sounds interesting - if libse could be used without modification that would make an updated mac version more possible.

pmdida commented 4 years ago

@rmanne Are you also able to open videos in SE with Mono ? I am trying your way it works fine, but when asked to open a video it says the right codecs need to be installed, I guess the way to go it to use mpv as described here, but I don't how to do the equivalent of what they describe (symlinking libmpv.so) on Mac.

rmanne commented 4 years ago

@didaKtik I never tried opening videos and no longer run macOS, so can't test either. I imagine you can just install mpv through homebrew and symlink the same way, the main difference would be that you symlink a .dylib instead of a .so file. Not sure.

pmdida commented 4 years ago

Here is a solution that fully works (video also) on my Mac (Mojave 10.14)

Download an Ubuntu virtual machine (Ubuntu 18.04.1 LTS in my case) (done with Parallels 15-day free trial, to be tested with free solution (VirtualBox))

Download mono-complete (not mono-devel) as instructed on the mono project download page.

Download the right version of SubtitleEdit here (at the time of writing it has to be SE 3.5.11 Beta), extract the .zip in your Ubuntu files.

Download the required additional packages (reference here):

sudo apt install libmpv-dev vlc libhunspell-dev tesseract-ocr

Run SubtitleEdit.exe with mono:

mono SubtitleEdit.exe

I didn't have to symlink anything 👍

radiomik commented 4 years ago

Also, @oxguy3 write a osx launcher using Wine - https://github.com/oxguy3/subtitle-edit-launcher

First of all thank you Nikolaj for your amazing piece of software. I've been using it for a while now and always had bootcamp installed in my mac just to be able to use your program.

That said, I've tried out running SE through Wine on my iMac (Mac OS High Sierra) and almost got it to work just fine. Seems it's only able to work in 32bit mode for me, but I think that's because Wine's support for 64bit is still quite limited. I'm getting video with no problem (using mpv) and everything else seems working so far except for the waveform functionality (which is essential in my opinion, so renders the program unusable for me if I can't use that).

So here is what happens, I'm able to extract the wave audio using either ffmpeg or vlc, but once it's done the whole performance of the program drops to a level of unusable, and what's even more strange if you invoque for example the settings menu it won't show up. Even if you are able to create the waveform, the moment it's done you can't use the program anymore.. until you just hide the waveform. Then suddenly everything is working again normally with good performance and boom the settings menu shows up again. If you toggle again to show the waveform, you go back to unusable and menus not showing. Any ideas why this could be?? Thank you very much to you and everybody else helping in this project! :)

gil commented 3 years ago

Hey folks! Now that OSX dropped 32-bit support, Mono can't be used anymore, right? I tried to run without --arch=32 and it still breaks, I read somewhere that WinForms can't run on x64, at least not yet.

Are Wine or virtualization our only options now?

chenlung commented 3 years ago

Could we arrange a special crowdfunder? Perhaps a machine for a developer or just their time. The staff could determine when that should be (e.g. when the software or third-party components are deemed stable/workable enough).

I know it might not be sustainable, but if something can be established it might sew the seed for someone else to continue the effort after (perhaps with not as much effort).

twardoch commented 3 years ago

I have made a way to run Subtitle Edit on macOS 11, via Wine: https://github.com/twardoch/subtitle-edit-mac-wine

There is a simple "installer". This uses the whatever the newest release of the official SE for Windows is, so it should work. However — no guarantees! (I was mostly interested in CLI, not GUI.)

twardoch commented 3 years ago

Ps. If you try my approach and find it not working — please an open an issue at https://github.com/twardoch/subtitle-edit-mac-wine/issues

I may try to fix it then.

SidneyUA commented 2 years ago

Any news about possible MacOS version? This app is literally irreplaceable.

chenlung commented 2 years ago

MAUI has a release candidate (the first official one is seemingly intended for Q2 of 2022). Could someone check if it is suitable for use with Subtitle Edit?

niksedk commented 2 years ago

MAUI sounds very interesting (when it will be out in a stable version), but the lack of Linux support is somewhat disappointing :(

SE cannot just be recompiled to MAUI, so all 192 windows will be to be re-designed + UI logic re-implemented + all bitmap / drawing / font code re-implemented.

chenlung commented 2 years ago

Perhaps Linux will come down the line once Windows and Mac are settled?

niksedk commented 2 years ago

@chenlung: MAUI does not support embedding an external video player in a control, which makes it impossible to port SE.

See https://github.com/dotnet/maui/issues/6843 So if you want SE on mac, give the above issue a like !

Hopefully in a future version of MAUI :)

chenlung commented 2 years ago

@niksedk I wonder about an editor without video in the meantime (a special version for performing tasks such as conversions and analysis/fixes)? Might be possible to make headway until provisions for video become available.

Cankalay commented 1 year ago

What is the situation with a mac version?

niksedk commented 1 year ago

https://github.com/dotnet/maui/issues/6843 was closed, so mpv is not likely as video player... I think that Microsoft is working on a video player in Maui, so Maui will likely have a video player (probably poor) in next version, which might be out in November.

So for now you will have to use something like Parallels.

For very basic needs you might try the online version: https://www.nikse.dk/subtitleedit/online Or the command line version: https://github.com/SubtitleEdit/subtitleedit-cli

chenlung commented 1 year ago

Announcement (31st January) from Microsoft: Play Audio and Video in .NET MAUI apps with the new MediaElement

Is this what we've been waiting for, @niksedk?

niksedk commented 1 year ago

Announcement (31st January) from Microsoft: Play Audio and Video in .NET MAUI apps with the new MediaElement

Is this what we've been waiting for, @niksedk?

It's not anywhere near the good solution, but it's a start... and I was expecting this in the November release.

chenlung commented 1 year ago

Announcement (31st January) from Microsoft: Play Audio and Video in .NET MAUI apps with the new MediaElement Is this what we've been waiting for, @niksedk?

It's not anywhere near the good solution, but it's a start... and I was expecting this in the November release.

Hopefully, by November of this year, we'll have something usable. 😊

niksedk commented 11 months ago

Maui lacks a bit... especially mouse/keyboard handling, and the video player is unusable for subtitling atm... but you can like/vote on these if you want an SE version for MacOS:

shawkynasr commented 10 months ago

@niksedk Maui look like fix that issue. I hope soon using SE for MacOS (intel and M1 versions).

louis-mps commented 7 months ago

Hello, any news for the Mac version of SE ? I tried the different solutions on this thread but none of them worked.

emtheodore commented 5 months ago

@niksedk would also really love to know whether the maui issue has been fixed and whether a Mac version might be possible!

niksedk commented 5 months ago

Maui has improved somewhat :) I will give this a try again soon. I'm busy the next month or so, but then I hopefully have a little to time to play with Maui/SE.

louis-mps commented 3 months ago

@niksedk

Hello, I wanted to check in regarding MAUI/SE progress. I understand you've been busy, but I'm genuinely interested in any updates you might have made when you find a moment to spare. Please don't feel rushed; I appreciate the effort you're putting into this :) Thank you!

systemcrash commented 1 month ago

I would be most satisfied with the simple ability to edit adjust save/export subs on macOS, and leave all of the bells and whistles like audio/video sync to later, since those seem to depend on the .net runtime, largely.

Can MSVS produce a macOS binary? Or does one need to run MSVS on macOS to do that?

BrettDean commented 1 month ago

Maui has improved somewhat :) I will give this a try again soon. I'm busy the next month or so, but then I hopefully have a little to time to play with Maui/SE.

macOS devices with M1/2/3 processors may offer more accurate OCR results compared to Tesseract. (potentially)

You can find the source code for it [here](https://github.com/xulihang/macOCR/blob/main/OCR/main.swift).

Alternatively, you can directly run the compiled binary file from [here](https://github.com/glowinthedark/subtitles-ocr/blob/master/OCR).