so-rose / convmlv

A feature-rich RAW developer for Magic Lantern formats.
https://git.sofusrose.com/so-rose/convmlv
GNU General Public License v3.0
15 stars 0 forks source link

.wav error (Not moving .wav, because it doesn't exist) #26

Open thennicke opened 7 years ago

thennicke commented 7 years ago

I'm getting the error *Not moving .wav, because it doesn't exist. when processing a .MLV file that contains an audio track. The modularize branch has this error as well. The source of the problem seems to be line 2107 of convmlv.sh; SOUND_PATH="${TMP}/${TRUNC_ARG}_.wav" For me, the .wav in that directory is actually called newer.mlv.wav, hence the error. Anyway, after botching a fix for line 2107, I'm now getting a dcraw error: xargs: dcraw: terminated by signal 13 And the encoding fails, dumping just the .wav in my raw_conv/sample.MLV folder. I don't know how to fix this (seems to be a pipe error?), but hopefully this report is useful.

Update: I was running convmlv with -r 1-10. If I remove that argument, then ${TMP} seems to contain nothing but DNGs at line 2107; no .wav at all.

so-rose commented 7 years ago

Thanks again for the report! Stuff like this really helps me immensely. Just a quick curiosity question; in what capacity do you use convmlv :) ?

That line should be a regular expression (basically, "move all existing WAVs out", sounds like; at the moment it would seem my assumption about how mlv_dump names the WAV is flawed. Something like mv ${TMP}/*.wav ${OUTPUT}.

Maybe some Python might be in order for the extraction of WAVs from MLVs. mlrawvewer may have inspiration. As for the dcraw error - Absolutely no clue; I'd love to take a look at your changes though and try to explain it!

As for frame cutting with the WAV, I don't think I've even considered that. I'll add an issue to trim the audio to the length of the output footage, probably as part of modularize; this should correctly give encoded videos sound, for example.

thennicke commented 7 years ago

Thanks for the reply; it’s great to hear back so quickly when I report a bug :) To answer your question I’m just an aspiring artist with a strong preference for free software, which brings me to convmlv. I’m quite experienced at photo editing on linux (if you’re interested: https://commons.wikimedia.org/wiki/User:Thennicke), but only recently have started dabbling in video. I couldn’t get mlrawviewer to do some of the things I wanted, and it’s not actively maintained, so I went searching for another way to process MLV files.

I’m currently just using convmlv as a script to convert my footage to prores [w/o sound :( ], mucking around and trying to find a workflow that works for me. And because it’s not such a huge codebase, it’s not so daunting to try and fix bugs in convmlv, although I’m not a very good/experienced programmer at all.

If you’re wondering what my “botched fix” was, it was just to use globbing, exactly as you did: mv ${TMP}/*.wav ${OUTPUT}. From there you will should get the dcraw error if you run convmlv with -r. I think.

And if you're adding an issue re. audio and frame cutting, you should know that when I manually extract the WAV and compare it in Pitivi to the video output of convmlv, the WAV always seems to be around half a second longer - perhaps the camera keeps recording audio for a moment after the video stream stops? If this is indeed happening (though it might be some other factor), convmlv might want to trim half a second off the audio in order to fit it to the video for encoding.

I've got a lot of time at the moment but my bash sucks, so I'll keep posting bugs as I find them. Though I might switch to using the modularize branch by default, because those bug reports are probably more useful to you.

Thanks for writing this script; it's really useful to me, even if it's buggy and sound doesn't yet work!

so-rose commented 7 years ago

Hmm. I'm half afraid it's an issue with mlv_dump not handling sound correctly when there's a frame range. I'll have to play around with it a little.

You know what, I'll end up in Python cutting audio segments to their correct lengths anyway. While I'm at it, I might as well add audio output format options like MP3, OGG, FLAC, and of course WAV. Maybe normalization too. Sounds like a modularize branch issue, to be honest - I added it to the 2.1.0 milestone.

Your art is quite good! And thank you for being a real-world user :) - I'm honored you're using my little script!