Page MenuHome

Export Subtitles bpy.ops.sequence.export_subtitles didn't account for Scene frame start
Closed, ArchivedPublic

Description

System Information
GNU/Linux (fedora 23) on an intel machine with nvidia gpu

Blender Version
Broken: current git master
Worked: never

Short description of error
when exporting subtitles from a scene that didn't start at frame 1, I noticed huge descrepencies on the timing. The operator looks at the subtitles frame start/end but doesn't account for the scene's. This could also export subtitles that start on negative frames (which is a bit weird)

Exact steps for others to reproduce the error
1- {F272144}load the blend file
2- alternate setting the start frame at 1 and 80, and export subtitles each time.
3- note that:
3a- the timestamps don't change
3b- the starting subtitle never is at time 0 even if it is on the start frame
3c- negative times are exported for the first strip.

I've made a patch that simply:
a- subtracts the frame start from the text strips timing
b- checks for negative time and doesn't export those subtitles (maybe this is tricky - we could enhance)
D1722

Details

Type
Bug

Event Timeline

bassam kurdali (bassamk) set Type to Bug.
bassam kurdali (bassamk) created this task.
bassam kurdali (bassamk) raised the priority of this task from to Needs Triage by Developer.

Looking back at my patch, it might be nice to check for the case where the start frame is negative and the end frame is positive, and export that strip with a start of zero (clip to zero)
thoughts?

Bastien Montagne (mont29) closed this task as Archived.
Bastien Montagne (mont29) claimed this task.

Closing the task, it’s enough to keep the diff patch - and this is not exactly a bug imho, more like new feature/behavior for this tool. ;)

hrmz, I disagree on the notabug decision. This is how I found it:

It was 3 am (ish) and I was finishing up a project on tight deadline. The client wanted a subtitle track 'cuz the video had to play in a tradeshow with possibly bad sound.

I exported the subtitle track from blender, and muxed it in in handbrake with the video (also rendered from blender). Then WTF'ed as they didn't align at all. I was too tired to figure out that the misalignement was a constant offset, so I ended up editing the .srt line by line in gnome-subtitle-editor.

After the project finished I tried to make a bug report but couldn't reproduce on a new .blend. It was only later, looking at my old file that I noticed that my sequence didn't start from frame 1. This is very common for me to do - it gives me room to pad from the beginning without sliding everything around - I bet a lot of other people use it.
Subtitle tracks are supposed to line up with the video track and audio; nobody is looking at the timestamps. Imagine if audio tracks behaved the same, and the only way you could get alignment is to start all your projects at frame zero (not even the default)!

In summary, I don't think this is a feature, it's a bug. typical type of bug too -when you don't consider the range of possible inputs, causing bad outputs at unexpected values, and easy enough that I could fix it myself.