Warzone2100 / old-trac-import

Archived Import of (old) Warzone 2100 Trac
0 stars 0 forks source link

Change subtitle timing from frames to time #748

Closed wzdev-ci closed 12 years ago

wzdev-ci commented 15 years ago

resolution_fixed type_patch (an actual patch, not a request for one) | by Kreuvf


It seems like the overlay texts lag behind. See the introductory video for campaign 1, it is quite noticeable there.


Issue migrated from trac:748 at 2022-04-15 19:02:33 -0700

wzdev-ci commented 15 years ago

Buginator commented


Can you be a bit more specific? Which part? What does the text in question begin with?

(I don't really have the time to sit and watch the whole thing, but the last time I did, I didn't see it was off by that big of a margin.)

wzdev-ci commented 15 years ago

cybersphinx commented


I think that was messed with when the videos were not available, to have the subtitles not show with the original timing, but directly one after another. Not sure if it was restored properly when video playback was reimplemented.

wzdev-ci commented 15 years ago

cybersphinx changed title from Video overlay texts do not match video to Video overlay texts/subtitles do not match video

wzdev-ci commented 15 years ago

anonymous commented


I likes to helps but no information is seen to fix this! Points me to directions!

I have French videos I like to use in wz how do I converts them and then uploads to svn to includes more French people?

thanx

wzdev-ci commented 14 years ago

Ronny.Standtke@... commented


I noticed the same problem with warzone 2.2.3 (self compiled under Kubuntu-9.04) and the high quality videos. The text lags significantly behind the video. When using the low quality videos the lag is smaller but still very noticeable.

wzdev-ci commented 14 years ago

Buginator commented


Replying to Warzone2100/old-trac-import#748 (comment:4):

I likes to helps but no information is seen to fix this! Points me to directions!

I have French videos I like to use in wz how do I converts them and then uploads to svn to includes more French people?

thanx

To convert the vids, there is rpl2avi in the tool directory of svn/trunk, then you need to convert them to theora.

However, I am not sure if we are allowed to have those videos.

Replying to Warzone2100/old-trac-import#748 (comment:5):

I noticed the same problem with warzone 2.2.3 (self compiled under Kubuntu-9.04) and the high quality videos. The text lags significantly behind the video. When using the low quality videos the lag is smaller but still very noticeable.

The only real way to fix them is for someone to tweak the values the game uses. Unfortunately, we don't have the time to fix it ourselves at this time. Patches will be gladly accepted. You would need to fix the values in base\sequenceaudio\camX where X is campaign number, and the files are plain text, either .txa or .txt.

wzdev-ci commented 14 years ago

Emdek commented


I've started to experimenting with converting frame numbers to make it match. I've modified intro subtitles and it works much better now, after multiplying frame number by 0.6055. I'll attach strings file. I've created small PHP script to convert these files, I can convert others too (probably multiplier will be the same). By the way, these texts should be frame independent, they should be shown depending on time, not frame number.

wzdev-ci commented 14 years ago

Emdek uploaded file devastation.txt (1.3 KiB)

data/base/sequenceaudio/devastation.txt, tested on trunk

wzdev-ci commented 14 years ago

cybersphinx commented


Maybe http://pastebin.com/mSHCSufS helps to find how things were changed, interesting files are probably src/seqdisp.c, and maybe those in lib/sequence.

wzdev-ci commented 14 years ago

Emdek commented


It looks like we need to rework all these values in data files anyway, maybe we could move to use video time (looks safer than depending on frame number)?

In lib/sequence/sequence.c we have function:

// get relative time since beginning playback, compensating for A/V drift

static double getRelativeTime(void)

Maybe it could be used for checking time insetad of frames?

wzdev-ci commented 14 years ago

Emdek commented


Here is patch:

http://wklej.to/ah8D

It does following:

This change needs subtitle conversion (I've converted it locally), moving it's files to data/base/messages/subtitles/ and moving audio files from audiosequence/ to audio/extras/. Additionally it looks like some files in messages/ are now obsolete (these containing duplicates of subtitles for extraction).

This would close tickets:

747

748

854

1207

1728

wzdev-ci commented 14 years ago

cybersphinx uploaded file subtitle.diff (18.6 KiB)

Emdek's patch inlined.

wzdev-ci commented 14 years ago

cybersphinx commented


Basic approach looks ok, I think. How are the subtitles in the .txt files handled for translation? I think for stats or something we surrounded the strings with _("") and adapted the parser.

For the file renames, can you leave that part out for now?

wzdev-ci commented 14 years ago

Emdek commented


Replying to Warzone2100/old-trac-import#748 (comment:12):

Basic approach looks ok, I think. How are the subtitles in the .txt files handled for translation? I think for stats or something we surrounded the strings with _("") and adapted the parser. Yes, it's done this way (doesn't affect display).

For the file renames, can you leave that part out for now? OK, this can be done later, for example with renaming ogg files, as suggested in another ticket.

wzdev-ci commented 14 years ago

Emdek uploaded file videoframestoseconds.diff (7.9 KiB)

Part of patch that replaces frame number usage by seconds

wzdev-ci commented 14 years ago

Emdek commented


I've prepared editor / previewer for subtitles, it can also rescale theirs timestamps using given multiplier. I've also have small script that uses constant value (based on value used for devastation.txt) to rescale all files. I can attach them when needed.

wzdev-ci commented 14 years ago

Beliar commented


Hi, i also noticed that the subtitles lag behind considerably when using the german sequences. I found out, that this is due to the english videos have a framerate 25fps while the german ones have 13fps (and the game use the frames to determine the time to display the text)

I have then investigated the source and made changes to use the seconds elapsed to determine that. I also made a small python script that can automatically change the values subtitle files to seconds (actually it makes a copy of the folders containing the files and makes the changes there) - yeah, i did all that before checking for already present tickets, and i don't really mind.

If you want i can add both a patch and either the python script (after some cleanup) or the changed files. My patch isn't too much different from Emdek though - at least the part that makes the change from frames to seconds.

wzdev-ci commented 13 years ago

cybersphinx changed type from bug to patch (an actual patch, not a request for one)

wzdev-ci commented 13 years ago

cybersphinx changed title from Video overlay texts/subtitles do not match video to Change subtitle timing from frames to time

wzdev-ci commented 13 years ago

cybersphinx commented


The main thing missing iirc was the conversion script, but another patch can't hurt (especially if it's done anyway).

wzdev-ci commented 13 years ago

beliar _uploaded file seq_text_time.diff (5.6 KiB)_

Patch for subtitles to use time instead of frame

wzdev-ci commented 13 years ago

beliar uploaded file convert.py (3.4 KiB)

Python script that converts the subtitle files

wzdev-ci commented 13 years ago

beliar commented


Just another note. If I remember correctly - and nothing changed, most videos had a fps of 25, but there where a few that had a different one.

wzdev-ci commented 13 years ago

beliar commented


Well, I'll upload both files. I can't guarantee that they work any more though. The python script has an optional dependency of some theora module to get the actual fps of the video files - which would my recommendation to use. I can't remember what the actual module was though. Maybe someone can replace that with something else. Anyway I updated the script so it can be run as a program. It needs Python 2.7.

wzdev-ci commented 12 years ago

cybersphinx changed status from new to closed

wzdev-ci commented 12 years ago

cybersphinx changed resolution from ` tofixed`

wzdev-ci commented 12 years ago

cybersphinx commented


Change subtitle timing from frames to seconds.

Based on patches by Emdek and Beliar. Closes #748.

wzdev-ci commented 12 years ago

cybersphinx commented


Took a while, sorry for the delay.

Emdek: Is your subtitle editor (http://emdek.pl/testy/tmp/wz-header/SubtitlesEditor.tar.bz2) under the GPLv2+?

wzdev-ci commented 12 years ago

Emdek commented


It can be. ;-)

I can prepare version with license and minor cleanups during weekend.