Blog
Page: 0 3 4 5 6 7 8 9 10 11 ... 15 ... 20 ... 25 ... 30 ... 35 ... 40 ... 45 ... 50 ... 55 ... 60 ... 65 ... 70 ... 75 ... 80 ... 85 ... 90 ... 95 ... 100
Stabilizing GH3 Video For Sony Vegas
Date: 19/5/2015
Tags: video
I have a GH3 camera that takes pretty nice video. Because I cheaped out and got a non-Panasonic prime for the lens, I don't have in lens stabilization. What I do have is a bunch of footage that needs stabilization so I've been looking around for software based solutions.

The first (free) one I heard about was Blender and it's point tracking. After downloading that and playing around with it I found it very limited in what footage it can work with. As soon as you pan or zoom it becomes very difficult to keep the footage zooming and panned correctly. There are scripts to help but because it's not core functionality it just gets complicated fast.

Then I heard about Deshaker, which primarily runs as a plugin for VirtualDub. A tool which I haven't used in a very long time. So I downloaded both of those and got to work testing it on my footage. Immediately it was obvious that it was vastly better and more powerful that Blender.

The first issue I faced when using VirtualDub was that the input video was .MOV files off the camera. This is the format from ffmpeg:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bec+tanner 038.MOV':
  Duration: 00:09:03.36, start: 0.000000, bitrate: 49552 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 48004 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Stream #0:1(und): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Stream #0:2(und): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
And VirtualDub uses .AVI files. Next step is converting the video to an AVI without re-encoding it. And that is best accomplished by my old friend ffmpeg. Which has the ability to convert between compatible containers without loss of quality and time caused by re-encoding the video. My initial attempt failed because the AVI container doesn't support big endian audio (the default off the camera). So I converted that to little endian using this command:
ffmpeg -i "input.mov" -vcodec copy -codec:a pcm_s16le "output.avi"
Now I could load my files into VirtualDub and stabilize them. The process basically involved adding 2 instances of the Deshaker plugin to the filter pipeline. The first one is set to "pass 1" and enabled. Disable the 2nd instance. Then go to the start of the video and runing the Output Playback mode. This generates all the motion vectors. Disable the first pass instance of Deshaker and enable the 2nd pass instance. Now you can export the video using your desired compression. I don't like any of the built in compressors so I downloaded the x264 codec and used that.

But the output had a problem. When the camera panned to track people walking, they appeared to jump back and forth in the stabilized output. Very odd looking. So I went frame by frame and noticed that in the source video each pair of frames coming through was the same. Deshaker then would get confused by this and shift the intermediate copy of the frame by more than the new frame. I thought the best way to get around this was to delete these redundant frames from the GH3. Fortunately VirtualDub comes with just such a filter: interpolate

By putting it in front of the Deshaker instances I got nice clean output, free of stuttering. At least as far as it would play in VLC. However when I loaded that into Sony Vegas there was big problems playing the AVI files back. Basically it would drop to a slide show, and on top of that there was corruption in the rendered output. Mulling my options I started looking for a way of getting the video out of VirtualDub without using the AVI container format. Fortunately there is a way. By installing an external encoder, which in my case was more just redirecting output to ffmpeg.

I found that by adding the right external encoder you can call ffmpeg to encoder the video straight from VirtualDub. The process involves writing out a "ffmpeg-1.vdprof" text file with the content from that link. Then importing that into VirtualDub and editing the details a bit. I decided to lower the -crf parameter to 16 to make it pretty much visually lossless. I don't want the stabilization to drop the quality at all.

Now I can bring that footage into Vegas and it plays smooth as butter. But it might have sent a few hairs grey.
(1) Comment | Add Comment

Scribe Gmail Support Update
Date: 4/5/2015
Tags: scribe oauth2
Google has switched off so called "insecure" authentication methods, including "PLAIN", which Scribe relied on.

Today I got that draft implementation working enough to be able to login to the Gmail IMAP server using OAuth2. It does take you via a detour into your default browser but in the end it works. It's also quite the hack job at this point so I want to clean up the code and make the error handling at least very verbose. I will be making a release in the next few days off the stable branch that includes functional OAuth2 support.

It has been argued that Google's motivation in doing this is to force people onto the web and out of installed desktop / mobile clients, for the purpose of making Gmail's web UI more palatable. I remain unconvinced about this argument in that there seems to be another reason that makes more sense to me. OAuth2 doesn't require the client to store the plain text password. Thus reducing the possible points of failure for security. Most installed clients are bad at storing persistent account credentials in a fully secure fashion. So by removing that attack vector it could be argued that Google is doing App authors a favour.

Maybe.

I still find OAuth2 quite needlessly complicated. And it's very dependent on the client having lots of pre-configured knowledge about the server it's authenticating with. I mean for every service that Scribe will support OAuth2 authentication I have to have a unique ClientID and ClientSecret, as well as the token URI and access URI... none of which are "discoverable" on the fly, but hard coded in. So you can't connect Scribe to some arbitrary new service that supports OAuth2. I have to manually create support each new service. I don't yet understand how that is a reasonable state of affairs.
(0) Comments | Add Comment

Scribe Gmail Support
Date: 24/4/2015
Tags: scribe
So Google have changed the authentication support for Gmail again, breaking the ability for Scribe to log in to any of the Gmail related services. Which means I'm going to have to put aside the v2.1 work temporarily to work on getting one of the support authentication methods working in Scribe.

The options are:
  • XOAUTH: Seems deprecated.
  • XOAUTH2: Probably the best bet at this point.
  • PLAIN: Despite it being listed as "supported" it doesn't actually work. It errors out and gives you some HTTP link in the server response. They really should remove it from the list.
  • PLAIN-CLIENTTOKEN: Well this one is weird... there is literally no documentation anywhere on what it is. Otherwise I'd be persuing this as a simpler option than XOAUTH2.
I'll try and keep this post updated with progress on that front.

The list of all official SASL mechanisms is here. PLAIN-CLIENTTOKEN is not mentioned at all. I wonder what implements that? Also of note, both XOAUTH and XOAUTH2 are marked "OBSOLETE". Nice one Google, supporting only obsolete, undocumented or non-functional authentication methods.
(0) Comments | Add Comment

Scribe v2.1 Update
Date: 21/4/2015
Tags: scribe
It may look like nothing is happening but really, there is. I have been toiling away on features and bug fixes in the v2.1 "trunk".
  • Scripting
    The functionality I want is all there in beta form. I haven't however ported any plugins to use it. So this is at least ready for some more testing.
  • Html Editing
    This is probably the least progressed of all the new features. Basic functions work but it's all so very fragile. I've been meaning to valgrind it heavily but the other features have been getting my time so far.
  • Built-in Aspell
    I got this finished to the point where it can self install a dictionary (from an FTP link no less!) today. So it's out of alpha and into system testing. I'll also need to make some changes to the installer to make it part of the base install.
  • Automated Crash Reporting
    No progress so far.
  • Mac Native Look
    Most of the controls now use native paint methods. Which have all been updated to non-deprecated API calls. Also very importantly the string display code now supports sub-pixel positioning, which fixes the selection of text in Scribe causing glyphs to move around in the x direction slightly. Painting isn't perfect yet, but it's a lot better. Ready for beta I'd say.
  • Calendar UI Refresh
    Still partially complete. No recent work.
  • Logging
    All changes completed.
  • Linux Betas
    I've done a lot of work to support arbitrary colour spaces which is heavily used by the Linux port. Also I've fixed a number of increasingly weird GTK interaction bugs. It seems if the bugs are getting weirder and less frequent, then you are reaching a decent level of stability.
Also of note, I've removed all the ANSI api support in the Windows implementation of LGI which means that any hope of running it on Windows 9x is gone for good. XP has been the official minimum for a while now, and now it's cemented in the code as well.
(0) Comments | Add Comment

The Current State of Scribe
Date: 23/2/2015
Tags: scribe
Maybe it's time to just bundle OpenSSL in Scribe? I'm thinking of statically linking it so that it's always available and there will never be any trouble with missing or mis-matched libraries. The downside is the download size will blow out a bit. Over 2 MiB for the Windows build, maybe even 3. Recently I've had a very bad time with people have all sorts of weird crashes, odd behaviour and connection issues. And it seems that these things are next to impossible to reproduce. Maybe it's the target market changing on me as the profile of the client gets higher.

One of those odd behaviours is Scribe not saving it's settings between sessions. I suspect this has to do with the install folder being write only, but the software thinking it's in portable mode (i.e. store settings in the install folder). I'd love for someone to be able to reproduce that and tell me how.

So I'm going to look into ways of avoiding pitfalls. I'm starting to think that making automatic crash reporting default to "on" is for the best. I'm simply not getting enough data to respond to problems.

The HTML editing functionality is coming along nicely. I managed to send quite a few HTML messages over the last few weeks. But it's still pretty flakey. And also there are some thorny issues to sort out. However it's a lot better than even a month ago so there is hope.

Also I finally fixed an old crash in the GWindow destructor on the Linux/GTK2 build. The other main sticking point there is the popup handling under the GTK2 platform isn't great. But I didn't see the point in tackling that when the software was still crashing all the time.

Edit: So I think I've worked out the procedure for the not being able to save your settings bug:
  • Install on Windows 8.1, user grants admin rights to installer.
  • Installer writes files to the install folder and then offers the user to start Scribe
  • If user starts Scribe, the installer runs Scribe.exe WITH ADMIN RIGHTS!
  • User selects "Portable" mode during Scribe's first run.
  • User configures some options and then exits Scribe. Scribe saves the options to the program files install folder and that works because it still has the ADMIN permissions from the installer.
  • User runs Scribe again... this time with USER permissions... and now Scribe can't write to the program files folder anymore... DUN DUN DAAAA!
Yeah I'm going to have to make sure that Scribe is aware that during startup that it may have ADMIN permissions, and not to assume it will be able to write to anything in the Program Files folder tree. However it should totally take advantage of having ADMIN rights to setup the registry for being the default client / registered client.
(0) Comments | Add Comment

Scribe v2.1
Date: 27/1/2015
Tags: scribe
So the v2.0 builds are basically stable as far as I can tell. Although there is some issues with some people connecting to SSL servers and one report of a crash at startup on MacOSX 10.10 (which I'm investigating). In the light of that I'm shifting my attention to the features in the v2.1 branch. I want to go through the things I'm aiming to get into that release:
  • Scripting
    Firstly as you may have seen in previous blog posts there is a visual debugger now. There is also support for calling external functions (i.e. in a system or 3rd party DLL/so/dylib). This is all with a view towards making the plugin functionality script based rather than C++ binaries. The problem with C++ binaries is they are VERY dependant on a stable ABI (application binary interface). I hate having to rebuild the plugins every time I release. If the plugins are scripts they will generally just work between releases and not need updating.
  • Html Editing
    This is a big missing feature and I'm committing to getting some basic functionality stable. To start with I want to match the text based functionality with a few extras like bolding, colours etc and then start adding more stuff like images and block quotes etc. It'll be a long road but I better get started.
  • Built-in Aspell
    Instead of requiring the user to install an old Aspell independently, from v2.1 onwards there will be a modern version of Aspell pre-installed. Dictionaries will still need to be downloaded on demand. The port to windows has been done, and stability testing and integration is underway.
  • Automated Crash Reporting
    It's most likely that in the first few releases of v2.1 there will be some automated reporting of crash dumps. Yesterday I wrote up a guide for reporting crashes and that will be the basis for the automated reporter.
  • Mac Native Look
    The mac port is already looking a lot more native with scroll bars, check boxes and radio buttons all taking on native rendering. I'll be looking into integrating native edit controls as well. I don't like the current rendering of text in the edit controls... the kerning keeps jumping around.
  • Calendar UI Refresh
    The calendar event window is in the process of being rewritten to be more modern and match existing systems. This will enable better workflow and integration with vCal files.
  • Logging
    All the logging now goes through the log window instead of ending up just in 'Scribe.txt'. This means that users can access pertinent log information directly through the user interface. There will be an icon that you can put in the main toolbar to show that log, and it will change appearance when there are new messages.
  • Linux Betas
    The GTK port on Linux has been running OK for a while now with a few issues. The main one is that the popup windows are all pretty flakey. And try as I might the GTK API doesn't leave a lot of room for fixing that. In any case I'll be getting some builds up and see how they go.
If you think I'm missing something really obvious that chime in either on email or in the comments on this post.

I'm looking to get the first build out sometime in Feburary.
(0) Comments | Add Comment