After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 596325 - Titles (text overlay)
Titles (text overlay)
Status: RESOLVED FIXED
Product: pitivi
Classification: Other
Component: Title editor
Git
Other Linux
: Normal enhancement
: 0.91
Assigned To: Pitivi maintainers
Pitivi maintainers
Depends on: 681774 703482
Blocks:
 
 
Reported: 2009-09-25 16:03 UTC by Jean-François Fortin Tam
Modified: 2013-09-19 19:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jean-François Fortin Tam 2009-09-25 16:03:48 UTC
We need to be able to add and edit text for making titles, with a transparent or color-filled background, etc.

Once we have that, we can proceed to make a parody of PiTiVi in yet-another-remix of Hitler in the Downfall. And I can stop using PNGs all the time to make title cards.

Not the same as bug #569818 (which is about having a dynamic "subtitle track" for generating srt files or embedding them in the container format), and probably not the same as bug #585131 (which seems to be about importing files with subtitles instead).
Comment 1 Dafydd Harries 2010-04-08 18:51:59 UTC
I have a branch for this in progress here:

http://git.rhydd.org/?p=pitivi;a=shortlog;h=refs/heads/titles

At this point, the main thing missing is undo support. There is scope for UI improvements too, but I'm not sure that's a merge blocker.
Comment 2 Jean-François Fortin Tam 2010-04-08 21:56:10 UTC
Some issues remaining in your branch

- The fact that the UI needs lots of love/ability to set the position in a WYSIWYG way), but as you said, it's not a merge-blocker per se (but while we're at it, if you want we could work on this too).

- Try making the text or background red, it will be blue instead.

- Rendering is very flaky. Try playing with a normal video clip + text clip and making transitions, rendering, saving the project, loading a project and rendering, etc. Symptoms: sometimes the render will hang at 0%, and otherwise the rendered file will usually be incorrect (the text is not rendered, incorrect duration, etc.)
Comment 3 Jean-François Fortin Tam 2010-07-21 18:02:28 UTC
Dafydd, ping? :)
Comment 4 Adam Knox 2011-02-06 05:27:37 UTC
Hi this sounds like a great feature. I think if this and transitions were added pitivi would be an incredible video editing tool.

I'd like to help out with this feature.

Let me know what I can do.
I have limited experience with python, but I'm eager to learn.
Comment 5 Jean-François Fortin Tam 2011-02-06 06:44:14 UTC
Thanks for offering your help, Adam! 
Are you familiar/at ease with Git? If so the first steps would be:

1. Checkout the "titles" branch of Dafydd's repo (http://git.rhydd.org/?p=pitivi;a=shortlog;h=refs/heads/titles)

2. Study a bit what Dafydd had accomplished so far in this branch (it "almost" works, according to my testing. It's only missing a few bug fixes and finishing up the user interface for editing).

2. Rebase the "titles" branch onto the pitivi master branch (git://git.pitivi.org/git/pitivi.git), because it's very old and has some conflicts with the current code.

3. Finish the implementation (basically, finish wiring up the GUI)


Since most of the hard work (back-end stuff/interfacing with gstreamer) is already done, I think it would be a reasonable and interesting learning experience to get familiar with Python and PiTiVi.

I hope this helps, let me know if you need more information (if you need some help with git or navigating the code, we could give you some guidance over IRC too).
Comment 6 Jean-François Fortin Tam 2011-02-07 01:03:05 UTC
I have rebased Dafydd's branch, it is now up to date with current master.
You can find it as the "titles_experimental" branch in my github repository.

To check it out in your current pitivi git repository:

git remote add "nekohayo" git://github.com/nekohayo/pitivi.git
git checkout nekohayo/titles_experimental

To come back to master:
git checkout master

To work on your own derivative:
git checkout -b my_new_titles_branch nekohayo/titles_experimental

And then you can commit your work on my_new_titles_branch.
Comment 7 Jean-François Fortin Tam 2011-02-07 01:03:55 UTC
Oh you probably need to do a "git remote update nekohayo" after the first command.
Comment 8 Brian Grohe 2011-02-15 02:02:55 UTC
nekohayo: Is your repository stable for use? I need titles in a couple of days and images break the video.

Brian
Comment 9 Jean-François Fortin Tam 2011-02-15 13:53:36 UTC
Well, it can work to some extent (titles do render), but I wouldn't consider the branch "ready" or "stable" for general use. You may give it a try just for fun, or you may also try jpegs instead of pngs and see if that solves your problem.
Comment 10 Brian Grohe 2011-02-15 23:01:37 UTC
I can't use jpegs (I need transparency). I guess I will try to use your branch, do you want me to report problems back here?

Brian
Comment 11 Jean-François Fortin Tam 2011-02-16 01:45:29 UTC
Well I'm aware of the various problems with the user interface, the problem is getting someone to finish the job :) but yes, you can make a list of the issues you find with the current state of the branch.
Comment 12 Adam Knox 2011-02-16 02:18:11 UTC
I'm going to try to pick up this project over the weekend, but feel free to write a bug report or email me directly.
Comment 13 Oystein 2011-04-01 16:48:46 UTC
I have started to look at this. 

I have fixed some bugs.
- Moving of the text is now working properly
- The correct font is shown in the UI after a font has been changed. 

As noted earlier the code from Dafydd Harries already implements most of the functionality needed so I don't think there is too much work left to finish it. I will try to make the code "stable" and functional before I publish a patch. 

I'm new to gstreamer and gtk but I'll see how much I can get done.
Comment 14 Jean-François Fortin Tam 2011-04-01 17:45:14 UTC
If you have a git branch you're pushing your changes to, it could be nice to mention it here in the meantime so I can follow your progress!
Comment 15 Oystein 2011-04-03 14:19:59 UTC
All issues with the color selection has now been fixed.
There is still some work to do on the UI and some small problems with rendering, but now it is actually functional.

I would greatly appreciate any feedback on my coding and if anyone got suggestions on how to improve the implementation, I would be glad to know.
Comment 16 Oystein 2011-04-03 14:22:04 UTC
Here is my repository git://github.com/ooystein/Pitivi.git
Don't have too much experience with git, but I think that is configured right.
Comment 17 Oystein 2011-04-03 15:18:17 UTC
Transparency/opacity doesn't seem to work until an ERROR has occurred. You have to overlapp two titles to get the ERROR and then it will render both in the previewer and when rendering.

"ERROR [13594] [0x7f5c87b6a700] "<Pipeline at 0x3517d10>"        pipeline          Apr 03 17:16:31      _handleErrorMessage: error from /GstPipeline:pipeline0/GstBin:bin0/GnlComposition:gnlcomposition1/GnlSource:gnlsource: FileSourceFactory2/GstBin:bin5/pitivi+elements+singledecodebin+SingleDecodeBin:pitivi+elements+singledecodebin+singledecodebin4/GstAviDemux:avidemux35 (__main__.GstAviDemux): GStreamer encountered a general stream error. (gstavidemux.c(5187): gst_avi_demux_loop (): /GstPipeline:pipeline0/GstBin:bin0/GnlComposition:gnlcomposition1/GnlSource:gnlsource: FileSourceFactory2/GstBin:bin5/pitivi+elements+singledecodebin+SingleDecodeBin:pitivi+elements+singledecodebin+singledecodebin4/GstAviDemux:avidemux35:
streaming stopped, reason not-linked) (pitivi/pipeline.py:852)
"
Comment 18 Jean-François Fortin Tam 2011-04-03 15:35:08 UTC
Nice work on your branch!
The errors you are seeing currently might not be caused directly by your branch. Transparency is kinda broken these days.

Some items I had on my mind as a todo list if you're interested:
- it doesn't use the project settings' resolution and aspect ratio
- font and color settings are reset when re-opening the title dialog for editing
- we could remove the "Paste" button, now that I think of it; the user can already paste text inside the gtk text entry widget below.
- text alignment tools would be nice (being able to left/right/center align inside the text box, and being able to align the text box itself to center it horizontally/vertically)
Comment 19 Oystein 2011-04-14 22:45:45 UTC
Text alignment inside the text box is now implemented, but alignment of the text box remains. 

The title editor uses project settings for resolution, but I haven't figured out how to set the resolution on the TitleSource, since it's set before the __init__

I tried to merge my branch with the master branch but got some conflicts I think i din't resolve correctly since it introduced some new bugs. If someone could help me with that it would be great. I think the updates on the master branch should be merged into the title_branch before I try to solve some of the problems with the saving and loading of the titles.

How to do editing of previous made titles is also a bit unclear to me. Getting and option to edit the titles when right clicking on the title source in the source list is probably a solution?
Comment 20 Jean-François Fortin Tam 2011-04-15 00:30:38 UTC
Text alignment inside the box: nice! I'd use pushbutton widgets instead of regular buttons though. As for the alignment of the text box, I think simply having buttons to center it on the X or Y axis would be nice (there's no way users would want to left/right align the textbox itself).

Editing of previously made titles: yes, the right-click popup menu, but also I think it would be nice to be able to do so by double-clicking with the left mouse button (it makes no sense to play a title in the previewer).




Some tips for your rebasing problems (strange that there are now conflicts with Master again): when doing "git rebase master", the first conflict occurs on pitivi/ui/mainwindow.py:

<<<<<<< HEAD
=======
from pitivi.ui.startupwizard import StartUpWizard
from pitivi.ui.title_edit import TitleEditDialog
from pitivi.factories.title import TitleSourceFactory
>>>>>>> move title dialog code out of main window



These bunch of lines should become:

from pitivi.ui.title_edit import TitleEditDialog
from pitivi.factories.title import TitleSourceFactory


Then you can do:
git add pitivi/ui/mainwindow.py
git rebase --continue


Which brings you to
Merge conflict in pitivi/formatters/etree.py:

<<<<<<< HEAD
        uris = [source.uri for source in sources]
        project.sources.nb_file_to_import = len(uris)
=======
        uris = []

        for source in sources:
            if isinstance(source, TitleSourceFactory):
                project.sources.addFactory(source)
            else:
                uris.append(source.uri)

>>>>>>> etree formatter: support loading/saving titles


...You need to figure out how this one needs to be merged by looking at what happened in master and what happened at your commit that fails to apply, etc. Hope that helps.
Comment 21 Jean-François Fortin Tam 2012-03-01 04:01:16 UTC
So, with the port to GES, I've started my own derivative with a slightly different UI. It is currently in my "titles" branch on github; the UI is not finished and there is no backend to support it, but the backend should be relatively easy with GES. Help welcome.
Comment 22 Jean-François Fortin Tam 2012-11-20 20:56:31 UTC
The current status is that the bulk of the title editor UI was merged to master, but:
- The UI needs polish
- The implementation is flaky, especially the part where it allows you switch back and forth between the "source code" view of pango. I'm not too much of a fan of revealing markup codes to the user, personally... either that, or only reveal codes and do not allow a "live preview" inside the editing textview itself (only preview on the actual viewer).

- We're still missing something in GES/gstreamer to set the background color of titlesource to allow using only that element. See https://wiki.pitivi.org/wiki/Title_editor_design for an explanation.
Comment 23 Jean-François Fortin Tam 2012-11-20 22:28:28 UTC
Actually, #3 seems to be solved. There is ges_timeline_title_source_set_background ()   in the api docs in GES master now, it's just a matter of having video compositing/mixing again in GES, but that's a separate issue.

So what remains is to polish the UI, hammer down the flaky pango markup-vs-normal view madness, and also get rid of the silly "titles as overlays as properties of a video clip" approach and only keep the "each title is a clip by itself" approach.

Help wanted.
Comment 24 Jean-François Fortin Tam 2013-09-19 19:48:23 UTC
So, given that the basic title editor has been implemented, I'll close this long-standing bug report and open new ones for follow-up on individual issues.

This was implemented by...

commit 459532f4252d547f91427af517c35d0e3200295b
Author: Matas Brazdeikis <matas@brazdeikis.lt>
Date:   Tue Aug 14 08:49:39 2012 +0100

    Implement a title editor



...plus commits 2fae2bc04a to 418c44ea9 that provide fixes on top of that.