====== Unusual Workflow ====== {{:oss:sodankyla:tc_ocr.png }} It's been almost two months since the last post which I mostly spent pushing open-source tools to the limit with film-postproduction. Looking at the //rushed scans// for the //Wicked// offline-edit, I noticed that some sound-clips have gone missing and only the 16 bit versions of the audio have been synced to the new-timecode. No EDL has been provided by [[http://filmmore.nl|Filmmore]] either. dang. Before starting to count frames, slates and reels: The scanned pictures contains a //printed// version of the camera-timecode which was derived from the audio-recorder's SMPTE/LTC. So if one could parse the camera timecode one can relate the original-audio clock to the timecode of the offline-video.. Since the original EDL was no-where to be found and a second scan is not an option, I set out on this unusual workflow: - dump timecode for each audio-file - decode each video-frame, crop the timecode and OCR it to ASCII text. Then save the frame-number along with each detected timecode. - assign audio-files for given timecode to the video-frame, reassign audio-timecode (drop gaps) and write EDL that matches the analyzed video. {{:oss:sodankyla:w_ardour2.png?233 |'wicked' xjadeo & ardour session}} I'd estimated it to take 3-4 hours and ended up spending a day: Already the first step introduced quite some delay: ''sfinfo'' does not inform one about extended WAV headers. //libsndfile// supports it and I was looking for ''sndfile-info -b'' but was more quick to write some c-code re-using [[oss:xjadeo:xjadeo|xjadeo's]] SMPTE parser and moved on to step two, which surprisingly was much quicker: Using //vextract// from [[oss:sodankyla:start|sodankylä]], it took less than a minute until I started to pass frames to an OSC tool. The first test with ''gocr'' was a success. I tried with ''tesseract'' and ''ocrad'', both of which have a higher setup-cost, require more tuning and even turned out to be less efficient (char-set configuration, processing time). So ''gocr'' it is, for good measure I've forked ''vannotate'' and in not time I had two text-files: One with audio-, one with video timecode at two AM in the morning. Step (3) turned out to take most time: I implemented the offset calculation before taking a nap; and spend another two hours to write and debug a perl-script to generate - not an EDL - but an ardour session file. You won't believe how I high I jumped when it loaded the first session with 100 clips automatically arranged on four tracks! I justed completed step (4): bounce the tracks and master a preview DVD; quite easy with ''mencoder'', ''dvdauthor'' and ''mkisofs''. I've used my trusted [[oss:dvdmaker:start|dvdmaker]] script. The sources are available with the [[http://gareus.org/trac/sodankyla|sodankylä]] project and may end up as Plugins or interoperability tools for [[http://openmovieeditor.org|open-movie-editor]], [[http://lumiera.org|lumiera.org]]. Contact me if you want to push this project. For what it's worth: I've also prototyped an EDL editor using a AJAX/JSON interface to sodankylä and started to implement having learned from the prototype, but for now I'm back to sound-design. I also need to arrange travel to [[http://www.foms-workshop.org/foms2009/|FOMS 2009]], [[http://linux.conf.au/|linux.conf.au]] and I received an invitation to join the [[http://slug.org.au/|SLUG]] club. I'm really looking forward to escape this murky and damp Amsterdam. {{tag>FLOSS Video News}}