Closed faithfracture closed 5 years ago
@faithfracture
Thanks for raising this issue! Would you mind providing the entire command line that you used so that we can troubleshoot more effectively? This is likely going to be a @donmelton issue, but the rest of us might catch something if we can see the entire scope.
Thanks!
Sure!
This command throws the exception:
transcode-video --add-audio all --copy-audio all --copy-audio-name all --audio-width other=double --add-subtitle all --burn-subtitle scan --output transcodedVideoFile.mkv --filter decomb --filter detelecine --crop 0:0:26:8 --dry-run someVideFile.mkv
If I just remove the --copy-audio-name all
parameter it runs just fine. Likewise, if I add the name field to the audio track and don't remove the --copy-audio-name all
parameter it also runs as expected.
Thanks! I was hoping we'd see an easy fix, but that command line looks right. Bumping this up to Don.
If I had to guess, I'd say it's right here: https://github.com/donmelton/video_transcoding/blob/61f800fbc1e70bcdae9ace2d4c968abb4b834959/lib/video_transcoding/media.rb#L104
@faithfracture As @khaosx already wrote, thanks so much for opening this issue. And my apologies for this crash interrupting your use of transcode-video
.
When you write, "if I add the name field to the audio track"... Do you mean that you modified your original MKV input file to add a name
property using a tool like mkvpropedit
?
If so, could you attach the output of a scan of your original unmodified file here using this command?
transcode-video -vv --scan "/path/to/Movie.mkv"
Thanks.
As to the location of the crash, I doubt it would be in the media scanning code since removing --copy-audio-name all
would not prevent that code from running. But I've been wrong before. :)
Yep. I use the MKVToolNix mac GUI app, but yes - mkvpropedit.
Here's the output from transcode-video
Background on how this file came to be: I grabbed a few different interview clips that were originally separate titles on a DVD and used Blender to add a text scene with the question & the corresponding video so I could just have them all in one video file for my Plex server. First time I've used Blender to do this, so I didn't really pay any attention to the details of what it was spitting out. Just checked that it produced a video file that contained & played what I expected it to.
Not much of an interruption really. gsub
looked to be a string manipulation function or something, so it seemed natural to look for parameters that dealt with text (like audio names, subtitles, etc). Just divide-and-conqure the parameters. Didn't really take too long to figure it out.
Only reason I thought that might be the place is it looks like that bit is grabbing the audio name from a collecting & calling gsub
on it (which is what the displayed undefined method was anyways). Assuming Ruby lets you jam nil values into a collection, that just seemed like an obvious place. (If I knew anything about debugging Ruby (or had the time to figure it out) I'd probably just try to find it myself.)
@faithfracture Thanks for the quick response! And from the dump of the media.info
hash in your scan output I can see :name=>nil
there. Which is causing the following code in the prepare_audio
function in the actual transcode-video
source file problems:
info = media.info[:audio][track]
copy = (@copy_audio.first == :all or @copy_audio.include? track)
if @copy_audio_name.first == :all or @copy_audio_name.include? track
name = info.fetch(:name, '')
else
name = ''
end
name = @audio_name.fetch(track, name).gsub(/,/, '","')
That name = info.fetch(:name, '')
line is the problem because it's stupidly assuming that :name
won't be nil
. D'oh!
Again, my apologies for this bug.
I should be a able to get a fix out sometime this week. Stay tuned and thanks again for reporting the issue!
@faithfracture Perfect! 🤣
I should make a version of that that includes the amount of yelling & swearing at your computer that occurs at each stage, as well as the embarrassment & humility that comes with the last two stages, lol.
@faithfracture OK, the fix is in: https://github.com/donmelton/video_transcoding/commit/60ccb3eb283a138e0b517d91785e201d9ebdf28c
Should be released sometime later today.
Awesome! Thanks @donmelton!
@faithfracture OK, it's released Just gem update video_transcoding
and you'll get the fix.
Thanks again for opening this issue!
If you use the
--copy-audio-name all
option on an MKV that has an audio track with no nametranscode-video
will crash with{binpath}/transcode-video: undefined method `gsub' for nil:NilClass