antonioarthur / subtitleedit

Automatically exported from code.google.com/p/subtitleedit
0 stars 0 forks source link

Multiple subtitle files in one go #125

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is related to my other 'Fix common Errors..' feature request in an 
indirect way.

Here is the scenario:

Suppose I wish to shift the times of a number of subtitle files in one (think 
of a series whose subtitles all need the same timing adjustments).

Or, I'd like to 'Fix common Errors..' in all of them.

Or, change frame rates..

You see the picture.

Currently SE can do all these admirably; but when you have to do the same thing 
to a number of files, it does get tedious.

Could you consider (some how) working with multiple files and applying a 
certain action to all of them.

I am not suggesting scripting, because that would be hard to use; but the 
tabbed interface of SE could be used to open multiple files in one window and 
apply these actions to all of them.

Original issue reported on code.google.com by adem.meda@gmail.com on 15 Feb 2013 at 10:15

GoogleCodeExporter commented 8 years ago
Could you name your top five functions you would like to do on multiple files?

Original comment by nikse.dk@gmail.com on 18 Feb 2013 at 9:05

GoogleCodeExporter commented 8 years ago
Couldn't come up with a meningful fifth; so here is four:

'Fix common Errors..' [Should apply until number of fixes is zero or no more 
reducible]
'Adjust all times..'
'Change Frame Rate..'
'Convert to UTF8' [doesn't exist yet :) ]

Thank you :)

Original comment by adem.meda@gmail.com on 18 Feb 2013 at 10:45

GoogleCodeExporter commented 8 years ago
Could you name your top five 'Fix common errors' items?

Original comment by nikse.dk@gmail.com on 19 Feb 2013 at 6:37

GoogleCodeExporter commented 8 years ago
I almost always apply all the options in 'Fix common errors' --except when the 
language is other than English; in which case I uncheck 'Fix alone lowercase i'.

Original comment by adem.meda@gmail.com on 19 Feb 2013 at 7:24

GoogleCodeExporter commented 8 years ago
Hm, but it's a very long list... I'll start with the most important 5-10 items.

Original comment by nikse.dk@gmail.com on 19 Feb 2013 at 7:27

GoogleCodeExporter commented 8 years ago
But, why is the length of the list important?

Can't you simply use the current piece of code that does whatever it does on a 
single file and apply the same operation(s) to all the files?

Original comment by adem.meda@gmail.com on 19 Feb 2013 at 7:31

GoogleCodeExporter commented 8 years ago
I can use some of the code... but not the UI.

You can test current version here: http://www.nikse.dk/SubtitleEdit.zip
Tools -> Batch convert...

Original comment by nikse.dk@gmail.com on 19 Feb 2013 at 7:38

GoogleCodeExporter commented 8 years ago
Hmm..

Here is how I would do it :)

1) Add another tab. Lets call it 'Batch files'.

2) In there add a couple of buttons: 'Open files', 'Save files'

3) When the user does an 'Open files', let him/her select more than one file.

4) Display the names of those files in a checklistbox (i.e. a listbox with 
check boxes). And, initially check all.

5) If the active tab is 'Batch files', then any operation the user does with 
any menu item applies to all those files listed (those with checkboxes enabled) 
under the 'Batch files'.

6) When it comes to saving, among the altered only the checked ones will be 
saved.

7) As another nice touch, when the user double-clicks any of those listed 
filenames, SE should load that one as the active file for the user to edit 
further.

OK. This was me thinking aloud --hence, I am sure there are quite a bit of 
gap-filling is necessary; but I hope I have been able to describe the picture 
the way I see it.

Original comment by adem.meda@gmail.com on 19 Feb 2013 at 8:16

GoogleCodeExporter commented 8 years ago
I forgot one of the most important one: Batch converter between subtitle 
formats..

Actually, the one I am most interested in is SRT --i.e. I convert everything to 
SRT when I can.

And, there's a dire need for such a batch converter. I have found only one that 
claims to do it ( 
https://sites.google.com/site/tsdarkness/batchsubtitlesconverter ) but I have 
never been able to get it running. It crashes even before it starts (Win7 x64).

Original comment by adem.meda@gmail.com on 19 Feb 2013 at 10:50

GoogleCodeExporter commented 8 years ago
Did you try the new Tools -> Batch convert ?

It can convert multiple files to srt + UTF-8 + change frame rate + offset times 
+ some stuff from "Fix common errors" - http://www.nikse.dk/SubtitleEdit.zip

Original comment by nikse.dk@gmail.com on 19 Feb 2013 at 1:09

GoogleCodeExporter commented 8 years ago
I took a very short look --short, because (frankly) I hate the idea of having 
only "some stuff from" 'Fix common errors'.

I simply cannot think of a good reason why I would have to use a reduced number 
of options on a file just because it is an item in a batch.

Original comment by adem.meda@gmail.com on 19 Feb 2013 at 3:55

GoogleCodeExporter commented 8 years ago
OK, I've added the full "Fix common errors" - 
http://www.nikse.dk/SubtitleEdit.zip
Like or hate?

Original comment by nikse.dk@gmail.com on 19 Feb 2013 at 8:00

GoogleCodeExporter commented 8 years ago
I love the change! Thank you for adding the full dialog. Just what I need for 
editing 5*39 subtitles :-)

Original comment by snabel...@gmail.com on 19 Feb 2013 at 8:47

GoogleCodeExporter commented 8 years ago
Cool, then this issue is closed with commit r1642 :)

Original comment by nikse.dk@gmail.com on 19 Feb 2013 at 9:08

GoogleCodeExporter commented 8 years ago
Things happen fast here :) 

I was away for just a few hours and much has changed.

To test the new beast, I used a batch (mixture of .srt and sub) 143 files.

My summary is this:

Like:

-- I love it that SE can batch convert subtitle formats. This feature alone is 
worth its weight in gold as it saved me so much hassle and headache.

-- Full 'Fix common errors' is also great. I don't feel constrained anymore.

-- You have also let the user manually select the applicable language for the 
'Fix common errors', which is great too.

-- It is also very nice that I can simply drag&drop multiple files into the 
batch dialog.

Dislike:

-- There is no more time shift options. Could you please let us use the 
same/similar dialog for 'show times earlier/later'.

-- I still have reservations against having a dialog. Here are my the reasons.

A batch dialog, IMO, is the wrong way to do it. 

First reason is the 'user-experience' one: If the batch takes long, and the 
dialog is modal (which it is), then you're stuck with the app. You cannot 
move/resize it.

The other one is, it is a crippled (for the lack of a better word) version of 
SE -- you get only a shortlist of the functionality of SE. 

I, for example, would like to be able to use almost all the menu items under 
Tools and Edit (or the first 10 items under the 'Tools' and Search and Replace 
functionalities of the 'Edit' menu).

Finally, if it's not too hard, could you consider making the batch operations 
multi-threaded.

The reason is: When working with a batch of several files, using a single 
thread is a sort of bottle neck. Since all/most machines are multicore these 
days, using those cores would speed things up considerably.

My unscientific benchmark:

[Win7 x64, 8 GB RAM, AMD Phenom II, 6 core, 2.8 GHz]

With the 143 files (mentioned above) on SATA3 SSD, it took 238 sec (just under 
4 minutes).

Obviously, this is MUCH better than having to do them one by one, but given 
that the file sizes ranged between 19 KB and 73 KB, I'd say multi-threading 
would slash this time.

Two more things: 

-- If the user drag&drops multiple files on SE, could you make sure that it 
automatically displays and places them in the batch dialog.

-- Could you please disable the 'Convert' button while batch is in progrees. 
Plus, it would be useful if there was some sort of visual clue that the batch 
is running and ended.

---

Disclaimer: I'd like to emphasize that I am not being ungrateful --far from 
it--, SE does an admirable job as it is. And we all are grateful for that to 
you. All I'm trying to do is to suggest things that will make it even more 
useful for me (or, us, the users) which may or may not be implementable within 
your time constraints.

Original comment by adem.meda@gmail.com on 20 Feb 2013 at 12:20

GoogleCodeExporter commented 8 years ago
>There is no more time shift options
there is :)

>First reason is the 'user-experience' one: If the batch takes long, and the 
dialog >is modal (which it is), then you're stuck with the app. You cannot 
move/resize it.
OK, you can now resize / move it. Now SE just hides the main window, but I 
could allow both windows to be active...

>Finally, if it's not too hard, could you consider making the batch operations 
multi-threaded.
OK, now uses 4 threads (1 gui, 3 workers)

http://www.nikse.dk/SubtitleEdit.zip

Original comment by nikse.dk@gmail.com on 20 Feb 2013 at 8:43

GoogleCodeExporter commented 8 years ago
> OK, now uses 4 threads (1 gui, 3 workers)

And it show: What took 238 seconds for 143 files, takes less than 8 seconds.

> >There is no more time shift options
> there is :)

Where? I can't find any time shift options on tha batch form.

There's a 'show all lines earlier/later' spinedit, but I have no idea what it 
can be used for.

BTW, thank you for the progressbar. It helps a lot and saves me having to stare 
at it :)

Thank you.

Original comment by adem.meda@gmail.com on 20 Feb 2013 at 9:25

GoogleCodeExporter commented 8 years ago
A minor one:

I am guessing, currently, in batch mode, 'Fix common errors' is applied only 
once (per file) irrespective of whether more fixes are needed.

A better approach, IMO, would be to apply it (per file) as many times as needed 
until the number of fixes stabilize.

By 'stabilize' I mean this: There may be case when one fix can produce a need 
for another fix and this might become recursive causing the program to hang. 

To prevent that, I'd suggest keeping an eye on the remaining number of fixes: 
If the number of fixes needed for the current one is the same as the previous 
iteration, consider it done and move on to processing the next file.

Original comment by adem.meda@gmail.com on 20 Feb 2013 at 10:45