Avidemux Forum

Avidemux => MacOSX => Topic started by: JimmyTheSaint on November 20, 2016, 10:45:42 AM

Title: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 20, 2016, 10:45:42 AM
I haven't been able to get the subtitle filter to actually embed the subtitles on any Macintosh computer for several years. I've always had Windows computers where it works fine, so that verifies that I know what I'm doing. At this point, I'm down to one Windows computer, and its only function is to run Avidemux when I want to embed subtitles in video clips. Plus, I have to keep a Windows partition on one of my Macs via Bootcamp as a backup. I'd like to go all Mac with my stuff, but inability to embed subtitles on the macos side is my very last sticking point. I've looked and googled for solutions for years and have tried all the things advised (fonts, etc.), and nothing has ever worked. In fact, after googling for years, I've never seen a single case where someone giving advice actually verified that they'd embedded subtitles on macos. So my question is not how do I do this or how do I troubleshoot it, as I've worked on that and failed for years. Rather, I'd just like to see if there's anyone who's actually done it and can verify that success is repeatable. Then I'll try to compare notes with that person to try to get mine working by imitation, as analytical advice and deduction and educated guesses have simply proved ineffective.

My concern is that there is no one who's actually every embedded subtitles on a Mac. For example, no one's ever replied with experience to this thread: http://avidemux.org/smif/index.php?topic=16201.0
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 20, 2016, 10:59:35 AM
If that is the only purpose of windows usage, think switching to ubuntu.
On our avidemux demo channel 37 seconds video: Subtitle ASS long lines and moving text test (https://www.youtube.com/watch?v=l7UwG06UVus)

Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 20, 2016, 11:02:51 AM
So then that would be my only purpose of Ubuntu usage. I think it would be a better solution to finally determine why the subtitle filter hasn't worked in years--if ever--on a mac.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 20, 2016, 11:08:35 AM
I don't have the apple hardware to test. So perhaps you can and report back to the developers.
Does it work with this sample subtitle file:
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 20, 2016, 11:12:33 AM
short video howto Subtitle Hardcoding in to video (https://www.youtube.com/watch?v=dOtQPYwpPic&index=6&list=PLLGMi2RSm8sbiUG2tfv8mcCzJoEsK3JVN)

Lucky you, seems developer(s) have the hard/software to test. Could be you need an updated avidemux: http://www.avidemux.org/nightly/
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 20, 2016, 11:13:15 AM
Just tried with a small .ass subtitles on OSX
Works fine
??

Maybe SRT=>Ass internal convert is broken
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 20, 2016, 11:57:50 AM
Yes, the supplied test subtitle file worked fine, subs moved with no crashing. On Windows, extracting the subtitle file from an mkv file, converting it to .ass with Subtitle Workshop, then using that .ass file has always worked fine. I then always do the same small tweak on the subtitle color and shadowing from my notes, without possessing comprehensive knowledge of all the formatting possibilities. That's the process that's always failed for me on Mac, even when the subtitle file has been extracted via Windows and verified to be working correctly on the Windows side. But after looking at your sample subtitle file that just worked on my mac, I conclude that it's user failure on my part: my lack of knowledge of the format and its headers must be a factor here. Here's how my file looks:

[Script Info]
Collisions: Normal
PlayResY: 640
ScriptType: v4.00+
PlayResX: 853
Timer: 100.0000

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Rockwell Std,24,&H00FFFFFF,&H00FFFFFF,&H00000000,&H00C0C0C0,-1,0,0,0,100,100,0,0.00,0,3,0,2,20,20,20,1

[Events]
Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:01:40.89,0:01:45.32,Default,Default,0000,0000,0000,,Four billion years ago, the first marine life formed.


I note that the top of your file is different, with moving subtitles and whatever. But I only ever need to embed simple subtitles, modifying those digits to for simple appearance tweaks. I tried overwriting the top of my file with the top of yours, plus adding the following style after your "john" style:
Style: Default,Rockwell Std,24,&H00FFFFFF,&H00FFFFFF,&H00000000,&H00C0C0C0,-1,0,0,0,100,100,0,0.00,0,3,0,2,20,20,20,1
but that didn't work. So I assume I'm missing something simple about the file format that doesn't cause a problem on Windows, but does on macos. Can you tell me what I'm doing wrong?
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 20, 2016, 12:05:10 PM
I'm a basic user, so at 1st sight, i can't tell. Could be resolution related?

Perhaps you can find the issue with testing the script with video in http://aegisub.org/
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 20, 2016, 12:20:49 PM
Or the font (Rockwell Std) is not installed or has different name or alias? or type is not matching (truetype font ??? )
You could try: place font Rockwell Std ttf in same location as the ass subtitle file.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 20, 2016, 01:14:19 PM
As I mentioned, I've looked into the font issue before, and none of the suggested solutions ever worked. In this case, I cut and pasted your style specification, changing the style name to "Default," as opposed to your named styles. I can't use a named style because these subtitles that I extract don't use that field. I used the font "Comic Neue" and your font size, which work in your sample .ass file like so:

Style: Default,Comic Neue,45,&H006CECEB,&H006CECEB,&H00000000,&H00222222,-1,0,0,0,100,100,0,0,1,3,2,2,2,2,2,1
But still no subtitles appear.

Then I tried a global search and replace to change all my "Default" subtitle lines' style to your "john," but I still got no subtitles. So right now, I'm using a file that's identical to yours (which works) up to the events, and all my events are formatted the same as your "john" style, but mine doesn't work. It can't be a font issue because your "Comic Neue" font works with your sample file. Yet mine is the sub file that's embedded in the mkv file, and which works properly with Avidemux on the Windows side. Can anyone provide a clue?
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 20, 2016, 01:27:55 PM
Actually, there's something funny going on with your subtitles. I make a clip from 0:30:22-0:30:42 of my video, but the subtitle that gets embedded from your file is "Here is a normal line," which should only embed from times 0:00:01-0:00:02. If there's something in the headers that specifies relative or absolute time scaling, I can't see it.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 20, 2016, 04:43:32 PM
there some conditions in front of the script. As I stated it is a test script.

most likely the font is not installed.
File (1.48 MB total): comic-neue-2.2.zip Will be deleted on 27 November, 2016
Download link: https://we.tl/HWnyQHgaLt

when you download
QuoteAegisub is a free, cross-platform open source tool for creating and modifying subtitles. Aegisub makes it quick and easy to time subtitles to audio, and features many powerful tools for styling them, including a built-in real-time video preview.
You have following possibilities
- Windows    Full Install
- Windows    Portable Version
- OS X 10.7+    Full Install

It will give you a better understanding of subtitles.

I found more basic subtitle test files:

Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 20, 2016, 05:10:40 PM
Those sample files didn't work, either. Thanks for giving me fonts to install, but as I said I've experimented thoroughly with the whole fonts thing in the past. I mean, it's weird that even the most common fonts don't work, so I think it's more than a simple font problem, or else there are no fonts at all installed on the several macs that all exhibit the exact same problem, where all the Windows boxes I've had worked fine.

Jan, thanks for trying you're not doing anything on Mac, and we're now repeating all the stuff I've tried in the past. I did post this in the MacOSX forum. So I still have the same question as I began with this thread: is there someone who has actually used the subtitle filter on macos and had it work? @mean says it works: I beg of you, please give me more information or at least a file that worked with the subtitle filter on macos. Is there anyone here who actually uses a mac that can see some sort of mistake in the portions of my file that I posted above?
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 20, 2016, 05:29:34 PM
I tested with that one
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 20, 2016, 05:58:10 PM
Quote from: mean on November 20, 2016, 05:29:34 PM
I tested with that one
Well, that didn't work for me either. My mac's Font Book application verifies I have Arial installed, but the subtitle filter never embeds anything from your file. I've been through all the settings, but they're all the same as what works in Windows: video outpout := x264, audio output := copy, output format := mkv muxer, and everything else left untouched. I choose the subtitle file for the filter, no problem. It just never works on Macos (my MBR and my MacBook 12), but it works on Windows. Any suggestions?
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 20, 2016, 06:47:13 PM
IF you start it from the command line, any suspicious warning ?

It could be that i have something you dont on my machine
Which would be normal since it builds avidemux i.e.i have everything needed

I would guess something around fontconfig
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 20, 2016, 07:10:27 PM
No, I didn't see any kind of warning or anything when launching from the command line. The system log also didn't show anything obviously wrong, if that's the place to look. How do I troubleshoot fontconfig? I don't really know anything about fontconfig. I couldn't find fonts.conf--it wasn't in /etc--if that's the file I should be looking at.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 21, 2016, 06:10:35 AM
Have you downloaded and installed Aegisub on your Mac?

1) Aegisub Menu: File: Fonts collector ...
Action
(.) Check fonts for availability
[Start!]
QuoteUpdating font cache
Parsing file
Searching for font files
Done

All fonts found.

2) Aegisub Menu: Subtitle: Styles Manager:
Catalog of available storages: Default
[Edit]

Font:
Click on the fontname. A font list should be presented.
Select the font and see if it is showing in the Preview.

3) Aegisub Menu: File: Open Subtitles
Select AvidemuxTest.ass
Aegisub Menu: Video: Open Video
Select any video preferable a 720p or 1080i format.

You should have video showing and subtitle script loaded.
below the video press the play video button ââ€"º

the subtitles should be showing while playing video

(https://avidemux.org/smif/proxy.php?request=http%3A%2F%2Fimg5.fotos-hochladen.net%2Fthumbnail%2Faegisubtestt4oye8s02z_thumb.jpg&hash=8169a47052abb41f4ba52491f545a770dc689b5f) (http://img5.fotos-hochladen.net/uploads/aegisubtestt4oye8s02z.png)
click on thumbnail
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 21, 2016, 07:30:14 AM
Could you post the full output when started from command line ?
The use case would be
* Open video
* Add subtitle filter 4400.ass
* Preview, seek a bit throught video (the subs starts after ~ 2mn from memory)
* Close everything
* Post output as a .txt file

Thank you
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 21, 2016, 08:14:13 AM
Thanks for the advice. I'm not at my computer now, but I'll use Aegisub to verify the fonts situation. I've been using SUBtools on the mac side, but it doesn't have those font verification features.

@mean, I start Avidemux from the command line by running "open -a Avidemux" in a terminal window. Avidemux's gui then pops up as usual, and there's no output at all, which is why I assumed there's no error. I also checked over system logs and didn't see anything problematic. Can you tell me in more detail how to launch Avidemux so that it will show the kind of console information you're describing?
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 21, 2016, 08:34:46 AM
With Aegisub on mean's 4400.ass file, I get:

1) "All fonts found" with the Font Collector tool.
2) tons of fonts that all preview correctly with Styles Manager
3) the subtitles show while playing video

So Aegisub has ruled out the possibility of unavailable fonts on my Mac, correct?
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 21, 2016, 08:48:11 AM
do that instead
Go to where Avidemux2.6.app is
then from a shell

cd Avidemux2.6.App/Contents/Resources/bin
./avidemux >& /tmp/log.txt

And do as usual

The logs are now in /tmp/log.txt
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 21, 2016, 09:54:17 AM
Quote from: JimmyTheSaint on November 21, 2016, 08:34:46 AM
So Aegisub has ruled out the possibility of unavailable fonts on my Mac, correct?
Most likely so.
You don't have any country localization on the Mac (used OS language not being stock English, folder names are not standard, ...)?
All I could think of, from user side. You're in the best hands now. Hope you two can find out what is going on.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 21, 2016, 10:05:58 AM
Thanks for your help. No, no odd localizations. And remember that I get the same behavior on my MBR 2013 as well as my MacBook 2016, so perhaps I'm not the only one who would have this problem with the subtitle filter.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 21, 2016, 10:13:12 AM
Quote... /tmp/log.txt
Curious what this will reveal?
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 21, 2016, 01:22:56 PM
Bingo
Fontconfig error: Cannot load default config file
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 21, 2016, 06:35:56 PM
bingo, that's exactly what my log file says:

[m[Fontconfig error: Cannot load default config file
[ass] No usable fontconfig configuration file found, using fallback.


So how do I config a usable fontconfig file?
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 21, 2016, 06:48:51 PM
1- Copy the attached file to /tmp
2- from a commmand line,
   export FONTCONFIG_FILE=/tmp/fonts.conf
then start avidemux from the SAME command line

3- If it still does nt work, edit /tmp/fonts.conf and change

<cachedir>/opt/local/var/cache/fontconfig</cachedir>
to
<cachedir>/tmp/fontconfig</cachedir>

and then from a shell
mkdir /tmp/fontconfig

It is a hack to know if that solves the problem
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 21, 2016, 06:52:40 PM
Yes, after googling "fontconfig macos," I see this has been a problem for other people. I'll try your idea, but are we even certain that fontconfig is installed by default on my macs? I see recommendations to install it using Homebrew and MacPort, but I've never installed things on my macs that way. It's been a long time since I worked at the Linux level.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 21, 2016, 06:54:25 PM
The needed libs are bundled within the .app
And they are not configured

I'm not sure you need a server, if not the fonts.conf hack should work
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 21, 2016, 06:58:57 PM
Seems to work
After "okaying" the filter, it will take a few minutes to index the fonts
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 21, 2016, 07:14:21 PM
Yes, the first suggestion solved it--thanks so much. Now how do I permanently install the fix? I forget this stuff. Do I store the fonts.conf file in some particular location (there's no /etc) and then put the export command in a file someplace?
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 21, 2016, 08:02:17 PM
I'll patch the bundle so that it's done automacally
It will take a few days, i'm busy with something else

Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 21, 2016, 08:16:59 PM
I've made a blind fix
Result in 20 mn
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 21, 2016, 08:18:56 PM
Incredible, thanks.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 21, 2016, 08:26:55 PM
seems to be ok
http://avidemux.org/nightly/osx_sierra/Avidemux2.6_r2016_11_21_2274c2f46ba.dmg
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 21, 2016, 08:49:09 PM
Yes, that totally works. This is going to free up a lot of resources for me. I wonder why other users never brought this up before? Thanks again.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 22, 2016, 06:28:19 AM
- not everyone uses subtitles
- less avidemux users are on Mac
- ...
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 22, 2016, 07:01:05 AM
Quote from: Jan Gruuthuse on November 22, 2016, 06:28:19 AM
- not everyone uses subtitles

Yeah, I've found that out in the three years that I've been working on this problem. What I want to do is quite simple and straightforward, so I'm still surprised so few people do this: you have a subtitled MKV file with a subtitle file inside it. You want to make a clip from a small portion of the video, while also keeping the subtitles. You can't simply use the subtitle file because the timing of, say, a 1-minute video will run from 0:00:00 to 0:01:00, but the minute you clipped is from the middle of the video. In that case, the subtitle file will not contain the correct timing. I realize I can use a subtitling program to adjust the timing of the extracted subtitles, but that turns out to be quite a lot of work to get it just right and embed the clipped subtitle file in the video. Clipping with avidemux makes it a no-brainer, as long as you can use the subtitle filter. That has the disadvantage of hardcoding the subtitles, but that doesn't matter in my case for the short clips because the original full-length video contains the editable subtitle file. I need to make about 50 short clips per video, so using the subtitle filter saves me a lot of work over any other method. You would think there'd be other people who make short clips from long, subtitled videos, but apparently not. I've tried to get other colleagues to use this method, but they're technology-challenged and so they minimize their use of clips (when they shouldn't) and end up fumbling around when doing presentations. In my case, I pre-make all my clips and have them all lined up so that I'm not searching back and forth for the right spot in a video to show.

I think lots of people make clips from long videos; the need to subtitle is much less encountered, but I *must* preserve the original subtitles.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 22, 2016, 07:21:59 AM
Perhaps with the gained momentum in developing (mean and eumagga0x2a). Avidemux developer(s) might decide to tackle subtitle(s), time permitting.
My user wishful thinking and does not reflect the developer(s) view point .
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 22, 2016, 07:23:55 AM
Quote from: Jan Gruuthuse on November 22, 2016, 07:21:59 AM
Perhaps with the gained momentum in developing (mean and eumagga0x2a). Avidemux developer(s) might decide to tackle subtitle(s), time permitting.
eh? it's done. As pointed out above, the subtitle filter now works on my macs.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: Jan Gruuthuse on November 22, 2016, 07:35:32 AM
- Exporting subtitle(s)
- Editing video and keeping the subtitle data in the stream.

Not an easy task, but time permitting, you never know.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 22, 2016, 07:36:43 AM
Quote from: Jan Gruuthuse on November 22, 2016, 07:35:32 AM
- Editing video and keeping the subtitle data in the stream.
yeah, that would be the dream.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 23, 2016, 09:12:47 AM
Any chance of getting an El Capitan version with the subtitle filter fix? I tried the Sierra version on my El Capitan mac, but it crashes when preparing the fonts while loading the subtitle file.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: mean on November 23, 2016, 06:32:42 PM
Not sure the compilation node is still working
I4ll have a look
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 23, 2016, 06:36:12 PM
Oh, wait, don't bother. I was able to update my older Mac to Sierra. I'll test subtitling on it tomorrow.

I wasn't able to update it previously because the Bootcamp partition, where I ran Avidemux on Windows to get the subtitling, was preventing OS update. But since the subtitle filter's been fixed for mac, I deleted the Bootcamp partition, got a whole lot of hard drive back for my use, and updated to Sierra.
Title: Re: has anyone ever gotten subtitle filter to work?
Post by: JimmyTheSaint on November 24, 2016, 06:50:17 AM
After updating my other Mac to Sierra, I've verified that subtitling works as expected, so I withdraw my request for an El Capitan version.

One oddity: the font size on the Mac size has to be set to double what it is on the Windows side in order to get the same sized subtitles.