jliljebl / flowblade

Video Editor for Linux
GNU General Public License v3.0
2.65k stars 180 forks source link

Project load hangs at "Unpickling" when loding project with non-ASCII chracters. #341

Closed lalegion closed 7 years ago

lalegion commented 7 years ago

Hello to everyone! I'm a new user to flowblade but have been producing video for more than 15 years. I find flowblade to be the only true professional oriented video editor on linux. That's why I'm so excited about it. So far it has been rock solid (Running on Mint 18.1 KDE / Acer v3 772g laptop) but today when I was trying to open a project I saved yesterday, flowblade just lock on loading with a message "Unpickling". And that's it, have to kill the program... Any ideas???

Flowblade 1.10

Thanks in advance, Lalegion.

dvdlvr commented 7 years ago

This is in the part that loads the project. There could be something in the file that causes a problem. If you can attach the flb file that you are trying to open I can try to find out where the problem is. And from that hopefully find a solution.

lalegion commented 7 years ago

Ok I think I have discovered something. The problem seems to be with the name of the project itself. I was using a spanish sentence as a name: "Año nuevo" and apparently the character 'ñ' is somehow not supported. I was able to import all my footage and even save the project but if I tried to open it later it would stuck on "Unpickling..." I was able to reproduce this effect twice.

Renaming the project with Dolphin and renaming inside the project file with kate (in text mode) can solve the problem.

Thanks and hope it helps!! It would be very interesting to know if you can reproduce this.

Lalegion.

dvdlvr commented 7 years ago

I created a project with the same name "Año nuevo.flb" and was able to open it without problem, several times. I've closed Flowblade and opened it fresh, then opened the project without problems.

Maybe it's linked to Mint, as I'm on Ubuntu 16.10. Or it could be linked to some environment variable. Perhaps LANG? This is my setting $ echo $LANG en_US.UTF-8

lalegion commented 7 years ago

Ok, thanks for your time... I'm confused now... by the way $ LANG resolves to: sv_SE.UTF-8

Might be mint... Lalegion.

jliljebl commented 7 years ago

We had an earlier report on similar issue, and I added this line just fix it:

    PROJECT().name = unicode(os.path.basename(filenames[0]), "utf-8")

...but the proglem didn't reproduce then either. @lalegion can you run Flowblade in terminal and post output here?

lalegion commented 7 years ago

Wow I'm even more confused now! I opened terminal and run flowblade (just typed "flowblade") and the problem disappears... just like that! but if I opened flowblade the normal way, through the desktop menu, then it happen again "Unpickling..."

this is my konsole when running flowblade:

lalegion@Planet-Legion ~ $ flowblade FLOWBLADE MOVIE EDITOR 1.10

Launch script dir: /usr/bin Running from installation... modules path: /usr/share/flowblade/Flowblade MLT found, version: 6.0.0 OS: Linux Mint 18.1 Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] GTK+ version: 3.18.9 User dir: /home/lalegion/.flowblade/ Locale: sv_SE Translations at /usr/share/locale were not found, using program root directory translations. Use OS locale language. 1920 1080 Small height: False Small width: False Detecting environment...

video_codecs:

dvdlvr commented 7 years ago

Ah, that is interesting. I always started it from the command line when I didn't have the problem, but when I open it through the desktop I have the same problem and I get a crash report when I open the project.

The title is: flowblade crashed with AttributeError in fps(): Project instance has no attribute 'profile' Traceback text attached. flowblade-crash

lalegion commented 7 years ago

Uff Good to know... I was starting to feel like Cassandra.. ;)))

dvdlvr commented 7 years ago

Well, I had to look up what that meant. You're never too old to learn :-)

On 02/22/2017 12:53 PM, lalegion wrote:

Uff Good to know... I was starting to feel like Cassandra.. ;)))

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jliljebl/flowblade/issues/341#issuecomment-281648952, or mute the thread https://github.com/notifications/unsubscribe-auth/AHkxP1fJBTYASqH6hx-uq4L5sCXmRk3Bks5rfCGsgaJpZM4MHxRo.

lalegion commented 7 years ago

By the way, the first time I opened it, it did crash because I waited without touching until it finally crashed (had the feeling the program entered a kind of loop because before crashing the computer went unresponsive) after that, I have always interrupt the "unpickling" by closing it. So no crash..

jliljebl commented 7 years ago

So works from terminal but not from installed .deb...holy hell this is nasty.

The cause seems relatively clear:

...and this only shows on some systems...effin hell.

This will be fixed for next release, there are multiple ways of doing it, we just need tio figure out what is best way to do it, simplest being adding try: except: in BigTCDisplay._draw but there may be other approaches.

jliljebl commented 7 years ago

Ok, I just pushed the quick fix. This still needs more work because the problem is fundamentally in the design: load has to run in own thread, we have limited control on Gtk requesting draw events, some objects are un-pickleable and have to be destroyed on save and re-created on load.

All this doesn't add up perfectly, but I thought that possible problems would show in development, but apparently not.

dvdlvr commented 7 years ago

@Janne: With the quick fix in place I still get the same result: A 'standard' project with only Latin letters will open without a problem, when launched from the dash, but a project with a name containing a special character will not load, as described.

However, I now get a different crash report. Same style, but probably one or two lines further down the line. flowblade-crash-2

If I open Flowblade, then a normal project I get no crash. If I then open the special name project it will just hang (with the Unpickling msg) and I don't seem to get crash report. If I open Flowblade, then a special name project I tend to get the crash report.

I'll start putting some debug messages in the code that starts with the Unpickling message to try and pinpoint exactly where it hangs.

jliljebl commented 7 years ago

Ok, tell me know what you find out. Both problems are caused by project attributes being accessed before they are re-created on load, project.c_seq is added back to project object at line persistance.py 412.

We should fix all these instance by instance and/or try to find a common cause that can be eliminated.

dvdlvr commented 7 years ago

Ok, got it. The problem is caused by this debug message in persistance.py around line 360 print "Loading " + project.name + ", SAVEFILE_VERSION:", project.SAVEFILE_VERSION

It's the project.name part that causes the problem. I tried replacing it with unicode(project.name,"utf-8") but then it still hangs. Just removing the print statement solves the problem. So, still not sure what the underlying problem is in project.name, but the project is loaded normally and the name is properly displayed after opening, once the print statement is commented out. flowblade-no-crash

jliljebl commented 7 years ago

I have no clue at all of the cause of this. Well, that print statement has to go, let's just put in something like "Loading project...", but I would like to understand this issue, the project name is in utf already, so maybe converting it utf -> Python type str could somehow make this go away.

dvdlvr commented 7 years ago

I tried using str() on it too, but to no avail. I'm trying to find out what the problem is. We can print the project profile_desc without a problem at the same point in the program. I'll have to read up on string types and conversions in python.

dvdlvr commented 7 years ago

I still have a problem with github - only 1 valid patch was used for the pull request :-) I haven't found the underlying reason, but the fix, which is removing the project.name print, should work.

jliljebl commented 7 years ago

Well, its not always super easy to stuff I right with git. I haven't done a pull request in a while don't remember clearly, but I think creating a development branch and doing patches in that (instead of master branch), and then doing pull request from that branch is a way to go generally.

jliljebl commented 7 years ago

WORKAROUND FOR THIS ISSUE:

1) Start Flowblade in terminal with command: flowblade 2) Load the project causing the problem. 3) Save it with name that has only ASCII characters.

Problem is fixed in 1.14 but I'm leaving this open for now for info purposes.

lalegion commented 7 years ago

Hey Thanks a lot to both of you for taking the time to help! Will stay tuned!

jliljebl commented 7 years ago

Fixed in 1.14 closing.