Magic Lantern Forum

Using Magic Lantern => Raw Video => Raw Video Postprocessing => Topic started by: 66dellwood on October 25, 2016, 05:00:37 PM

Title: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: 66dellwood on October 25, 2016, 05:00:37 PM
Using a Canon 5d2. I convert my MLV files with MLVProducer.  Latest builds for both.  MLVProducer generates CDNG files and related WAV. audio files.  However, after conversion, the video and audio are not linked together.

In Resolve, I need to manually drag both the video clip and the related audio clip into the timeline, separately. The ML audio files are always slightly longer than the related video clip (making it more of a pain).  Lots of wasted time when initially setting up timelines compared, for example, to h.264 files with linked video and audio tracks that automatically load into the timeline together.

Is there a quicker manner to bring the Magic Lantern video and audio files into Resolve?

In Resolve's Media page, you can manually link the audio clip to the video clip. But this has to be done one clip at a time.  Useful when syncing the occasional off-sync audio files but not helpful to save time when setting up the timeline.

I was hoping there is a Resolve setting, a MLVProducer setting or a Magic Lantern setting that would automatically link ML video with audio so both would be loaded into a timeline at the same time.

Any fixes or work-arounds?   or just another price to pay for working with raw video?
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: Danne on October 25, 2016, 05:09:09 PM
The audio must be equally long or shorter to embed in resolve. That and correct metadata in wav file.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: 66dellwood on October 25, 2016, 06:24:35 PM
Thanks Danne.  What settings do I need to check to make sure my audio length is adjusted?    Currently, all my audio files are slightly longer than my video files.  A frame rate issue?

And how do I confirm correct metadata in the wav file?

thanks.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: Danne on October 25, 2016, 07:15:40 PM
I gave some hints to the programmer and I think he created so metadata is included.
I shorten length of audio if too long in MLP and use bwfmetaedit to insert ixml information into the wav file. You can also check metadata with bwfmetaedit. But since you are on windows that is of little help.
you can also upload an example of audio, I can check, or you can simply shorten audio and check if embedding works after that.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: 66dellwood on October 25, 2016, 07:48:31 PM
Danne, I noticed I had enable FPS Override.   Could this be messing with the audio recording?

I posted a related question on the General Help and Q&A board.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: Danne on October 25, 2016, 08:14:07 PM
No. It,s when you stop mlv recording and the audio cut is not cut exactly corresponding to amount of frames. Best is if MLVproducer could simply cut or truncate audio so it match with frame rate. Count amount frames and divide with frames per second to get correct audio length.
Sometimes audio is probably cut tiny bit shorter than video and in those cases embedding should work.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: 66dellwood on October 25, 2016, 09:30:55 PM
So this is likely a conversion issue with MLVProducer?   The audio files are not being generated at the same length as the video?
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: Danne on October 25, 2016, 09:38:21 PM
First it is an issue in cam since it,s often a little bit longer than footage. Then again having audio recorded alongside MLV is remarkable. Don,t think it can get closer in match. Secondly it can be fixed in post matching audio length so that is the solution to work with I think.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: AWPStar on October 26, 2016, 03:18:16 AM
Danne
Quotemetadata in wav file
What kind of data? What is should contain?

I'll check the number of frames.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: dmilligan on October 26, 2016, 03:49:47 AM
Sorry didn't notice this double post. http://www.magiclantern.fm/forum/index.php?topic=18066.msg173827;topicseen#msg173827

Quote from: AWPStar on October 26, 2016, 03:18:16 AM
What kind of data? What is should contain?
Have a look at wav.c (https://bitbucket.org/dmilligan/mlvfs/src/9f8191808407bb49112b9ab14c27053ae5022749/mlvfs/wav.c?at=master)
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: AWPStar on October 26, 2016, 04:21:31 AM
@dmilligan
Thank you!

As i understand it's about this chunks? I'll try. Thx again!
Quote//bext subchunk
    char bext_id[4];
    uint32_t bext_size;
    struct wav_bext bext;
    //iXML subchunk
    char iXML_id[4];
    uint32_t iXML_size;
    char iXML[1024];



Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: Danne on October 26, 2016, 07:30:40 AM
@AWPStar. We had a conversation about this about a year ago(referred to dmilligan wav.c)about where to put in fps and such in the ixml part. Recheck those maybe?
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: dmilligan on October 26, 2016, 03:56:55 PM
Quote from: AWPStar on October 26, 2016, 04:21:31 AM
As i understand it's about this chunks? I'll try. Thx again!
Yep.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: 66dellwood on October 26, 2016, 05:49:48 PM
guys, thanks for pitching in.  this would be a very useful fix.  thanks much.   I assume there is no in-camera fix for the longer audio clip length.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: 66dellwood on October 28, 2016, 05:29:07 PM
Thinking that I may have a settings issue in Davinci Resolve, I posted a similar question on the Resolve forum.

https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=53217

One response worth repeating:  " [MLVP] doesn't name the wav file according to convention, so Resolve doesn't recognize it as belonging to the DNG sequence."
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: AWPStar on October 30, 2016, 02:08:25 AM
It works! I can upload exe-file to you without new release.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: 66dellwood on October 31, 2016, 02:52:43 PM
"It works! I can upload exe-file to you without new release."

Fabulous.  Would love to try it.  Let me know how to try it out.
Title: Re: Linking Audio and Video clips with MLV converted files from MLVProducer
Post by: 66dellwood on November 02, 2016, 06:04:40 PM
Indeed!  This version works.  Audio files are trimmed and linked to the CDNG video clip.  Saves a lot of time importing media into Resolve.  thanks much!!

2 notes:

1.  After conversion from MLVP, for each clip, I get a folder containing the CDNG sequence and a wav file at the beginning of the folder; I also get a separate list of all the wav files.  So MLVP seems to be rendering duplicate wav files.  One in the video folder and another.

2. Some of the audio clips are out of sync.  I have not had time to experiment with many clips on my 5D2.  Audio seems to sync fine with 1280x720/23.9 but I loose sync with 1856x1044/23.9 clips.

Is it possible that the higher rez clips are over taxing the 5D2 causing dropped frames or other issues causing audio to loose sync?