Category Archives: Film-making

Play Avid Meridien MXF or OMF with FFplay

You may have found an old Avid drive containing MXF or OMF files compressed with Meridien codecs. Sometimes these are known by their compression ratio, e.g. “2:1” or “14:1”.

Because of the combination of the MXF/OMF container and the Meridien codec, rarely found in modern software apart from Avid, these files can be difficult to play, even if your QuickTime installation contains the Avid-distributed codecs.

So how can you view these files for free?

Easy. Avid Meridien compression is actually MJPEG – Motion JPEG compression. The free and open-source utility FFmpeg has a sister player: FFplay. Even though it doesn’t know how to find an MJPEG codec inside an MXF OP1A wrapper, or an Avid OMF wrapper, you can tell it what to do with a simple command line. Then, you can view any Meridien-compressed MXF or OMF files on your drive.

As a guide, MXF video files are named in the following way:

CLIPnameVnn.<ID>_<ID>.mxf

ID” is a hexadecimal string that Avid uses to track the media. The pattern for OMF files is similar.

When the letter ‘V’ follows a clip name, and is succeeded by a pair of digits, you’ve found a video file. Then, the command to play it is:

ffplay -f mjpeg CLIPV01.<ID>_<ID>.MXF

The trick is the “-f mjpeg” in the command line. This forces FFplay to interpret the file as containing data encoded as Motion JPEG.

And now you can see your pictures. They’ll play with the VBI data included, and the colour range may appear washed out because you’re displaying broadcast-level pictures on a computer-level display.

Export Avid Mixdowns straight into FFmpeg

Avid’s export capabilities have been rough around the edges, to say the least, for some time, especially when trying to use QuickTime to encode into a non-native codec such as H.264. But you can now perform a mixdown within Avid to your favourite native Avid codec, and then use FFmpeg to combine those renders directly into a single multiplexed file suitable for burning to DVD or web upload. You don’t need to export from Avid itself.

Here’s how.

First, mark an in and and out point in your Avid timeline, and perform two mixdowns one after the other; one for video, one for audio. For your video mixdown, use the codec that appears most often in your sequence, or the codec you used for most or all of your renders.

Internally, your mixdowns will have been saved by your Avid as MXF files. For a sequence with stereo audio, there will be three files: one for video, and two for the audio (being the left and right channels).

At this point, you can close your Avid application, or use it for something else. The processing that follows takes place separately from the Avid program.

Use Windows Explorer, or the Mac Finder, to locate the most recently modified files in your “Avid MediaFiles” folders. In this example case, this was shown to me:

top-of-avidmediafiles

The last three files, with similar filenames, are the video file and the two audio files that were created during the mixdown. FFmpeg will now encode and multiplex these three files to produce what you need.

If you’d like to perform something else useful on the audio at this point, e.g. making its level meet the EBU R.128 loudness specification, that’s easy. First, I measured the volume:

ffmpeg -i "\Avid Mediafiles\MXF\1\LECTURE 25i 11JUNE2558B15BD.mxf" -i "\Avid MediaFiles\MXF\1\LECTURE 25i 11J558B15BD.1.mxf" -filter_complex "[0:a][1:a]amerge=inputs=2,ebur128=peak=true:framelog=verbose[aout]" -map "[aout]" -f null NULL

…and out came the result:

[Parsed_ebur128_1 @ 0000000000c7c3c0] Summary:

Integrated loudness:
I: -17.1 LUFS
Threshold: -27.6 LUFS

Loudness range:
LRA: 4.9 LU
Threshold: -37.7 LUFS
LRA low: -20.5 LUFS
LRA high: -15.6 LUFS

True peak:
Peak: 2.3 dBFS

So the audio gain in dB required is:

-23 - (-17.1) = -5.9

Also, check the “True peak” value. If it hits 0dB, you’ve probably got some clipping and may want to revise your audio mix. In any case, your broadcaster will want the True Peak to be below a specified value after your volume has been adjusted. In the case above, there is indeed a spike that is reconstructed by FFmpeg’s interpolation algorithm, but which was brought into specification by the volume attenuation in the next step below.

Next, in my example, I issued a command line to do several things:

  1. combine both audio streams into a single stereo stream,
  2. adjust the audio gain,
  3. encode the stereo audio stream,
  4. post-process the video stream to clean it up, and resize it for YouTube’s 480p format,
  5. encode the video stream,
  6. add some useful metadata to show decoders how to behave,
  7. multiplex the encoded streams together.

The constant-rate-factor value (-crf option), which determines the encoding quality, is deliberately kept high because online services such as YouTube and Vimeo always recode.

Here is the whole command line I just used to create a standard-definition YouTube upload, with colour and video levels correctly encoded into the bitstream:

ffmpeg -i "\Avid MediaFiles\MXF\1\LECTURE 25i 11JUNE2558B037E.mxf" -i "\Avid Mediafiles\MXF\1\LECTURE 25i 11JUNE2558B15BD.mxf" -i "\Avid MediaFiles\MXF\1\LECTURE 25i 11J558B15BD.1.mxf" -filter_complex "[1:a][2:a]amerge=inputs=2,volume=-5.9dB[aout];[0:v]hqdn3d,scale=854:480,smartblur=1.0:-1.0,setdar=16/9[vout]" -map "[vout]" -map "[aout]" -acodec libfdk_aac -vbr 5 -vcodec libx264 -aspect 16:9 -crf 18 -x264opts fullrange=off:transfer=bt470bg:colorprim=bt470bg:colormatrix=bt470bg -metadata title="Elsewhere and Otherwise" -metadata artist="Peter Messer" LECTURE.mkv

With just two quick command lines, my Avid mixdowns are ready for YouTube upload without having to rely on any of Avid’s strange interaction with QuickTime during export. And the encoding is much faster than Avid can manage.

Diplacusis — or why do some people hate violins?

tl;dr — I had very disturbing diplacusis (double hearing) during a really bad bout of influenza, but recovered after a month.

The Diplacusis Diary

Being a Tonmeister, and loving music all my life, I didn’t understand what drove some people, even those in my family, to dislike violins. Where I enjoyed beautiful, warm, expressive singing tone, they heard “tuneless cats wailing” or worse.

Whereas the main complainant among my relatives didn’t seem to mind piano music too much, orchestras and violins in particular were, to her, the equivalent of a knife edge being dragged squealing across a china plate.

How could there be such a difference?

Until last month, I had no idea. But now I know.

For three weeks, my right ear has presented me with hideously detuned ghost orchestras, squawking organ pipes, shrieking violins and cracked bells. Music encoded using codecs such as MP3 or AAC sounded like it was being played through loudspeakers whose cones had been torn apart, and any perception of stereo was lost: everything was shifted about 40° to the left, while demonic pitchless musicians wailed over my right shoulder. In short, all pleasure in music was replaced by agony, and my work as a performing musician, occasional record producer and film editor appeared finished.

This is an essay on the ailment diplacusis, and my journey to safety through it. To be more accurate, my particular case was diplacusis dysharmonica, where pitch is perceived normally in one ear, but wrongly in the other. This article is no substitute for a professional diagnosis and a course of therapy from a medical specialist, but it is published to show how a musician and amateur physicist (me) worked through the nightmare, and was healed by the brain and body’s own resources.

Yes, I’m better now and, indeed, most people recover without intervention. But, if you have begun a similar journey, please get checked by the best professional you can find because many different causes lead to the same ailment. Most triggers that the body can’t fix on its own can be cured by pharmaceutical or surgical intervention. Please don’t hesitate.

Where did it start?

I have normal hearing for a 51-year-old, gracefully growing older. There’s a little high-frequency tinnitus but nothing to worry about. Then, in May 2015 began my worst bout of influenza ever. This brought about the kind of coughing and congestion that kills older people.

While blowing my nose rather fiercely, I felt and heard something nasty, probably mucus, shoot up my right Eustachian tube and into my middle ear. Or perhaps too much pressure was used and something inside my middle ear became damaged?

Immediately, I felt a sense of pressure as if my ear needed to ‘pop’ and, as usual, there was a dullness of hearing. This is perfectly normal when the pressures either side of the tympanum are unequal. But also, there was a new acoustic effect, as if my eardrum were in direct physical contact with my throat. Breathing and swallowing became much louder than usual in this ear alone. And popping my ears to relieve pressure changed none of this.

So, in the matter of a very short space of time, I had an ear that felt completely full of something, and that would not respond to the normal procedures. The next day, I was checked by a doctor who wanted me to visit the audiology department at the hospital if things weren’t getting better. The tympanum is translucent, and an expert can diagnose much by shining bright light onto it.

What did I notice?

Day three dawned. Outside my house, off to the right from where I sit for my everyday work, there is a church. The bell, which was being tolled to call the congregation for the morning service, had developed a problem. It sounded as if it been cracked, which was a pity because its sound was normally very pleasant, a reminder that this is a historic and pretty town. Later that day, there was space in the diary to visit the vicar to tell him about the sad accident that had happened in his bell tower in case he’d not noticed.

Then it was time to edit and master some music for a client. Despite the feeling of pressure in the right ear, sensitivity had returned so I fearlessly began work.

The first piece of music wasn’t from the usual excellent producer whose work normally went into this particular project and the difference certainly showed! The whole choir was way off to the left in the stereo soundstage, and the MP4 audio file sounded terribly distorted, as if encoded at a very low bitrate. The right hand channel, particularly, had incredible harmonic distortion and countless intermodulation products. I very nearly fired off a cheery email to my friend who usually provides this material, saying “it’s easy to tell this isn’t from you!”

Then I glanced at the meters and the waveform. The audio was in dual-channel mono. In other words, both audio streams were identical and panned dead centre. What on EARTH was I hearing? Were my speakers or amplifier blown?

Into a separately amplified output, my headphones were plugged. The sound was just as awful. But then the real horror began: turning the cans the other way around, the balance and wild distortion inside my head were identical, as if I’d not reversed the headphones at all.

So I checked just the left channel: and it was perfect. But with the right channel alone, not only was the sound like someone singing through a comb and paper, it was nearly a semitone sharp! The vocal timbre also sounded sped up, like a tape being played through a pitch shifter.

A first response

This was deeply unpleasant. “I’m broken!” was the first thought. After a lifetime of playing and loving music, and wondering why my mother didn’t like musical sounds at all, suddenly all my own pleasure in music was lost. The glory of stereo, “sound sculpted in space”, had gone. I could no longer tell if an instrument or singer was in tune. And judgement on matters of tonal balance was impossible.

Every day in the press, we read about people whose lives have been utterly ruined by accidents. Losing part of one ear is hardly equivalent to being crippled and confined to a wheelchair for ever. And if a person suddenly disabled can find a way through, it wouldn’t be too much trouble for me with one-and-a-half ears and all my limbs still working.

A bit sad for a musician and producer, though — the end of my lifetime’s ambition.

That afternoon, I played piano for a rehearsal. The whole echo of the church appeared routed through a pitch-shifter and screamed mockingly at me like a choir in the worst kind of horror movie.

Analysis

So, that evening, there was time to analyse what was happening.

Speech? All sibilants on the left, and sounding sped-up in the right ear alone.

Sine waves? Fine up to about 2kHz, then bad intermodulation distortion when feed to both ears: and pitch shift above 2kHz in the right ear alone.

Playing the piano? Everything an octave above Middle C and higher was surrounded by a vile cluster of discordant tones.

What about fun with heavily-panned Beatles’ songs, where the vocals or an instrument are fully on one stereo channel or the other? The trumpet solo in “Penny Lane” was unlistenable in part, though the brain did a good job of pulling some of it back into pitch on its lower notes. Over this, I had no conscious control: it was rather like watching a remotely controlled machine at work.

The Nat ‘King’ Cole album “Welcome To The Club” has the vocals bizarrely panned entirely on one channel. You can see where I’m going with this! And, yes, he was singing a semitone sharp. So was my enjoyment of music and my professional judgement over for life?

Over the week that followed, experiments continued. Every morning I’d be woken by the church clock chiming with all its harmonics in the wrong pitch (though the fundamental tone was fine), then I’d try the piano: there were clusters of evil upper partials on every note, and harmonies brought no pleasure or contrast. And recorded music encoded with perceptual codecs still sounded as if played through a class B amplifier with terrible crossover distortion.

Thinking in Physics

What might have been happening inside my ear? The feeling of pressure was still there, and everything above about 1.5kHz was pitch-shifted up.

If the workings of the ear are unknown to you, I suggest that, at this point, you take a look at some Wikipedia entries particularly regarding the tympanum, the ossicles, the cochlea and the organ of Corti. Remember how standing waves are set up along the basilar membrane, turning it into a spectrum analyser.

If you have access to a tone generator, try this: feed 2kHz or 3kHz into headphones, then clench your jaw strongly. Did you hear the pitch of the tone go up? Is the pressure on your ear affecting the bone holding your cochlea and therefore changing its shape, altering the places along the basilar membrane where different frequencies resonate, thereby fooling the brain into perceiving a different pitch?

Maybe something, maybe mucus, was putting pressure constantly on my cochlea, possibly on its oval window, permanently changing the places where resonance occurs when frequencies are higher than about 1.5kHz? This is in line with the place theory of pitch perception.

And perhaps the audio that is normally heavily modified by the MP3 or AAC algorithms, disguised by the normal ear’s processes, is revealed in all its distortion by my suddenly revelatory but damaged cochlea? In other words, the spectral lines that these codecs decide to distort, lost in the ear’s usual perception, are shown in all their awfulness now that they are shifted for the benefit of my aural education.

How to fix my ear?

So at this point, about two weeks before writing this essay, I resolved to get through this in several ways.

  1. Using commonly available open source software, I could have found where the frequency break in my damaged ear was, and design a process that maps frequencies above this frequency to slightly lower frequencies, thus restoring normal pitch perception for headphone use. Perhaps even a digital hearing-aid like this is possible?
  2. Middle ear infections cause pressure in the middle ear, so I was ready to do all that is possible to detect and clear any infection.
  3. I still had influenza and was very congested: so it would have been useful to keep using Olbas Oil and pseudoephedrine to clear any other sinus and Eustachian tube blockages.
  4. Retrain my brain regarding pitch. After all, as a baby, only after birth could the already-formed brain have been able to compare pitch sensations generated by the two ears and, somehow, co-relate them — so why not try to restart the process?

The strong upper harmonics in violins and pipe organs howled violently in my right ear: and, if my family member who hated such instruments also had unresolved diplacusis, perhaps this was the reason for her dislike of such sounds?

Cured

Now, the good news, for me at least. My ear has become decongested in the last week, and the shrill demonic orchestra and choir has faded to almost nothing. My stereo hearing is now back to its normal clean status, and music is a constant pleasure. I didn’t need to make my own hearing-aid, the decongestants seemed to work, and my self-training with tones and careful music listening perhaps helped too.

Sometimes, diplacusis can be healed in this way by the body and brain’s own natural functions. This has taken about a month for me.

If you have just experienced the very disturbing onset of diplacusis, maybe this essay has given you hope? But please get to a hearing specialist as soon as you can, in case your situation is different from mine, and you need surgical intervention.

And never blow your nose too hard.

University of Surrey Tonmeister Lecture

Thank you, Institute of Sound Recording! I was very touched by your welcome yesterday, though have never been introduced as a “Legendary Tonmeister” before. To be honest, that description is better owned by the likes of graduates such as Francis Rumsey, Mike Hatch or Jim Abbiss to name but three.

A full house of 2nd-year and final-year students, along with distinguished staff and alumni, came to hear my stories of music production, laughed in (some of) the right places, and asked a few challenging questions. If you were there and didn’t manage to speak up in the time allocated, please make contact through this blog or through the department.

Interest was expressed in being able to hear or see again the extracts of music and film that were critiqued, so I shall upload them in a way that might be useful to you in the near future.

The IoSR kindly organised some decent playback kit; my inability to see any of my lecture notes was my fault alone, so some of the material below wasn’t used in the lecture. Nevertheless, when it is written-up, it may possibly make sense.

This isn’t a blog version of my talk — you must come to the lecture for that — but you might it helpful to have notes of the recordings I used.

Each and every extract of a recording is accompanied by a critique of the performance or technique exhibited, so can be shown publicly in this context under the doctrine of Fair Use (in the USA) or Fair Dealing (in the UK, Europe and many Commonwealth countries).

Some recordings, e.g. the Stokowski, Stravinsky and Delibes early stereo examples, and the critique of the Elgar and Duke Ellington “accidental stereo” recordings, are still to be added. As is the tape of the Walter Gieseking Beethoven concerto performance recorded in Berlin in January 1945 where you can hear the bombs falling in the slow movement, again in stereo.

Index Description Date/Location Medium
1 Preussische Staatskapelle Berlin cond. Herbert von Karajan — Anton Bruckner, Symphony No. 8 in C minor, WAB 108 (III: Finale) 29 September 1944; Berlin Stereo tape
2 Michael Flanders & Donald Swann — A Song Of Reproduction (At The Drop Of A Hat) 2 May 1959; The Fortune Theatre, London Stereo tape
3 Paid in Full performed by Eric B. & Rakim, written by Eric Barrier and Rakim Allah 1985; Powerplay Studios, New York City Stereo tape
4 A Journey Into Sound — Train sequence, narrator: Geoffrey Sumner 1957, London Stereo tape via LP Decca SKL 4001
5 Under The Bridges of Paris played by Edmundo Ros and His Orchestra; Ping, Pong demonstration 1957, London Stereo tape via LP Decca SKL 4001
6 Cincinnati Pops Orchestra cond. Erich Kunzel; The Year 1812 (Festival Overture), by P.I.Tchaikovsky 1978; The Music Hall, Cincinnati, Ohio Soundstream digital + video
7 London Symphony Orchestra cond. André Previn: Images for Orchestra (I: Gigues) July 1979; No. 1 Studio, Abbey Road Prototype 14-bit stereo digital recorder
8 Something played by Steve Marcus (tenor saxophone), J. Inagaki & Soul Media 1970/71, Tokyo NHK 13-bit digital recorder
9 USA TV ad: Ronco Record Vacuum Unknown and best forgotten Unknown
10 Latin lesson April 1938; Eltham College, Mottingham, London BBC disc 870625
11 Let’s Begin played by Paul Whiteman and His Orchestra January 1933, New York City Victor, shellac disc 24453
12 Corner Pocket played by Harry James and His Orchestra 1976, Wylie Chapel, Hollywood LP disc
13 Money from the album Jazz Side Of The Moon Sepember 11–12 2007, St Peter’s Episcopal Church, New York City 24-bit stereo digital recording
14 I Can’t Quit You Baby performed by Led Zeppelin on the album Led Zeppelin Olympic Studios, London, 1968 Stereo tape
15 I Got A Woman performed by Ray Charles 18 November 1954, WGST, Atlanta, Georgia Mono tape
16 Alan Blumlein’s first stereo test 14 December 1933, EMI auditorium, Hayes, Middlesex British Library shelf mark 9TS0003378 two-track disc
17 Alan Blumlein’s first stereo test film 1933, EMI auditorium, Hayes, Middlesex Film, and two-track disc
18 Channel 9 (Australia) Today programme: Blattnerphone Restored 1992, Telstra Labs, Melbourne VHS off-air video / Blattnerphone tape
19 Preussische Staatskapelle Berlin cond. Herbert von Karajan — Anton Bruckner, Symphony No. 8 in C minor, WAB 108 (III: Finale) 29 September 1944; Berlin Stereo tape
20 Boston Symphony Orchestra cond. Pierre Monteux; Delibes: Coppelia suite December 1953, Manhattan Centre, New York City Stereo tape
21 Norelco 150 Cassette Recorder demo 1964, United States Duplicated Compact Cassette
22 Una furtiva lagrima from Donizetti: L’elisir D’amore February 1st 1904, Room 826, Carnegie Hall, New York City Single-sided shellac Victor 85021
23 Thomas A. Edison: Electricity and Progress for the opening of the New York Electrical Show October 3 1908 Edison Gold Moulded cylinder (unissued), NPS object catalog number: EDIS 39835

An influential voice becomes quieter

If you grew up in the English Midlands, you or your parents might have listened to Ed Doolan, a radio presenter who came from Australia to join the big Birmingham independent station BRMB in 1974. Some years later, when independent radio was changing its tactics, he was recruited by, and became popular on, the BBC station in the same city.

His programmes contained plenty of campaigning, endless local relevance, and listener involvement in countless forms. Ed Doolan’s voice, opinions and style have become very familiar to me over the last forty years and clearly influenced my own much smaller and less successful career in front of radio microphones.

I no longer live in the Midlands, but always tuned the car radio to BBC WM when in the area to hear his conversations.

Lately, Ed Doolan has gradually reduced his radio workload. He went on air on BBC WM the other day to explain to the station’s host Caroline Martin why he had retired from live broadcasting.

To hear this fellow, only 23 years older than me, and familiar over four decades, say “I’ve got dementia” simply halted all I was doing this afternoon. His full interview is here:

http://www.bbc.co.uk/programmes/p02hpwf3

Real-time visual pitch display

Here’s a hypnotic (or nausea-inducing) way of watching and listening to BBC radio programmes. You’ll need a modern version of FFplay, the multi-media player that’s part of the FFmpeg suite, and the open-source “get_iplayer” program. The filter that does the work is called “showcqt”.

For this example, I’m using BBC Radio 3. You will, no doubt, see how the command line can be modified to accept any audio source.

Just type this. This is from a Cygwin command line, rather similar to Unix. Windows won’t be much different.

get_iplayer --stream --type=liveradio "BBC Radio 3" | ffplay -f lavfi "amovie='pipe\:0',asplit[a][b];[a]showcqt=fullhd=0:timeclamp=0.3:fps=30[out0]; [b]anull[out1]"

Or, as another example, here’s one of my favourite on-line streams, “The Departure Lounge”:

ffplay.exe" -f lavfi "amovie='http\://listen64.radionomy.com/TheDepartureLounge',asplit[a][b];[a]showcqt=fullhd=0:timeclamp=0.3:fps=30[out0]; [b]anull[out1]"

…and, after waiting a few seconds for buffering, you’ll get this:

Audio spectrum of a fragment of a song for soprano and piano, with turntable rumble visible in the lower frequencies
Audio spectrum of a fragment of a song for soprano and piano, with turntable rumble visible in the lower frequencies

The backslash in the “pipe\:0” is because colons must be escaped with a backslash in FFmpeg/FFplay filters.

Just out of interest, I have a Python project that outputs a handy video and audio scope that needs a little refinement, but you can download it here: https://github.com/Warblefly/FFmpeg-Scope/

The scope’s on-screen display includes a waveform monitor showing superimposed YUV levels with 16-235 markers to check BT601/709 broadcast limits, an EBU R128 loudness chart, a stereo audio sum/difference display, a colour vectorscope, a full-range video check monitor and timecode.

This is the kind of output it gives:

Screenshot of FFmpeg scope
Screenshot of FFmpeg scope

Recorded music podcasts from the UK? No.

Is it truly impossible to send out a British-made podcast where recorded music is played?

It would seem so. Phonographic Performance Limited (PPL), who licence nearly all record labels’ recorded music for public performance, do not offer an Internet-only licence to include recorded music in on-line podcasts. Broadcasts are fine, where you can’t skip forward in a show: but not podcasts that can be manipulated on demand.

If something on-line is merely replicating an already broadcast radio programme, it’s fine. But Internet-only radio from the UK, using music on most record labels, is still not allowed.

Isn’t that a curious anomaly? The Performing Right Society, and the Mechanical Copyright Protection Society, who licence the music, are fine about it. But the record labels, represented by PPL are not.

One of the greatest powers of radio is to introduce music that is new to an audience, by allowing an expert curator to showcase records they have chosen. John Peel, late of BBC Radio 1 is an example that comes immediately to mind; likewise Lucie Skeaping or Andrew MacGregor, both of BBC Radio 3. But with an increasing number of young people turning exclusively to on-line sources, why can’t the Internet be allowed to broaden the range of curators (presenters, if you like) to include those without current BBC or independent radio contracts?

A discussion about this is going on right now, on the “Radio Today” website. Perhaps PPL will join in? Or maybe I’ll just phone them for a chat and report back?

A Government Falls

For some reason this morning, while watching the featureless sky outside this window and waiting for Prime Minister’s Questions to start, I’m reminded of a turning point in British political history.

Thanks to the UK Parliamentary Recording Unit, you can hear the exact moment in 1979 when James Callaghan’s Labour government was challenged, by Margaret Thatcher’s Conservative opposition, to a vote of no confidence. As everyone knows, the vote was carried and thus an election was forced leading to a succession of Conservative governments.

The speeches surrounding this motion, by the two party leaders, can be heard in longer form by clicking this link.

Converting video for DVD with FFmpeg

Here’s another quick command line for FFmpeg. It converts interlaced video and audio into deinterlaced DVD-ready files. Your output will be a VOB file, ready to be split into a file of the correct size by any DVD authoring program (e.g. DVDStyler) without any further recoding.

The command line you see below was written for a recent film show, where interlaced material had been supplied on DVD, where the projector would not resize interlaced video correctly, and where the only replay device was a standard DVD player.

This command line is careful to apply the appropriate flags to the bitstream to signal that the video uses broadcast levels, and encodes colour according to ITU Rec.601, the standard for European (PAL) SD television.

Two filterchains are in use. The video filterchain first de-interlaces the incoming video, then applies noise-reduction because the files given to me were already noisy and, therefore, would waste bandwidth after encoding. The audio filterchain delays the sound by just over a frame: I found this to be necessary, possibly because of delays introduced by the video coder and the video filter.

ffmpeg -i VIDEO_INPUT -target pal-dvd -vf "w3fdif, hqdn3d" -af "adelay=50|50" -color_range 1 -colorspace 5 -color_primaries 5 -color_trc 5 VIDEO_OUTPUT.VOB

MXF Op-Atom files for Avid

THIS POST HAS BEEN PARTLY SUPERSEDED BY THE MUCH FASTER METHOD SHOWN HERE: http://johnwarburton.net/blog/?p=50731 BUT SOME METADATA IS OMITTED.

This post shows how to convert almost any kind of video and audio into native Avid Op-Atom MXF files, suitable for placement directly in Avid’s MXF media files directory. The method is fast, and uses only open source software. Crucially, conversion takes place on any machine, not just an Avid-equipped computer.

A side note regarding AMA: it’s sometimes (?) a little flaky when linking to files that aren’t from a small subset of QuickTime, or that have their own manufacturer-tested plugins.

In this example, I am importing footage into a 25fps HD project. The Avid codec is its own DNxHD, running at 145MBit/s.

Use FFmpeg to convert your incoming footage into uncompressed audio files, and into Avid’s native video format. Note that the video is not encapsulated beyond the raw DNxHD format: but this format contains almost enough information about the file to enable import to take place. Frame rate, for example, seems to be missing.

So, convert the incoming video into DNxHD and uncompressed audio with FFmpeg like this:

ffmpeg -i "bach.flv" -vcodec dnxhd -b:v 145M -an -sws_flags lanczos -vf "scale=1920:1080, smartblur=1.0:-1.0" bach-video.dnxhd -vn -ar 48000 -acodec pcm_s16le bach-audio.wav

I have scaled the video to the correct size using what I consider to be the best scaling algorithm (Lanczos), and have added a little crispness to avoid too much softening. Obviously, you will not want to do this to footage that is already the correct dimensions and does not need restoration.

Now, we must prepare these files for Avid, in the same way that Avid itself imports files. They must be encapsulated as Avid-flavour MXFs (Op-Atom). Here, the BBC and EBU-supported raw2bmx utility, from bmxlib, comes into play. Again, this is open source software, and this is a very simple command line. Much more metadata can be included, and you’ll need to think about this if you’re going to reconform the project at any stage.

On this command line, I instruct raw2bmx to wrap both the video file and the stereo audio file into MXF. The project name is given, as is a tape name. The output file location together with the file prefix is given.

You will also need to specify the frame rate, using the ‘-f’ option, if your footage is not 25fps. The rates acceptable are: 23976, 24, 25, 2997, 30, 50, 5994 and 60. The incoming DNxHD is specified by “–vc3_1080p_1237”, naming the codec, picture size and flavour. All such flavours are listed in the help for raw2bmx.

raw2bmx -t avid -f 25 --project BACH --clip "BACH001" -o "I:\Avid MediaFiles\MXF\1\BACH001" --vc3_1080p_1237 bach-video.dnxhd --wave bach-audio.wav

In your Avid Mediafiles directory, a number of MXF files will appear: Avid’s Media Tool will pick these up as clips with combined video and audio (if that’s what you’re converting), and you can drag the clips to whichever bin you wish. Note that the raw2bmx tool is terse in its progress reporting. It prints nothing until the end of the wrapping process.

Recent builds of FFmpeg can be downloaded here, and the bmxlib project is on Sourceforge here.