lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
563 stars 26 forks source link

Batch conversion, what have I done wrong? #207

Open Kerbrer opened 3 months ago

Kerbrer commented 3 months ago

This is all incredibly new to me and while other-transcode is nothing short of magic for me, doing 76 episodes of a show one at a time is tedious and time-consuming. So I took a look at your wiki for how to do batch converts. I at least set it up as instructed, but when running batch.rb as either .\batch.rb or simply batch.rb, it deletes the first line as it's supposed to but nothing happens after that. It just goes back to a new command.

I'm mostly certain I didn't actually install WSL to install Ruby, but my command line window says "Start Command Line With Ruby". Am I boned? Or am I missing something?

Kerbrer commented 3 months ago

So I've made progress, now I get this error message, with [Path to file] subbing for my directories because I'm paranoid:

C:/Ruby32-x64/bin/other-transcode: scanning media failed: [Path to file]\batch.rb

I've tried it both ways as such: [Path to file]>other-transcode --add-audio all --add-subtitle all --copy-track-names [Path to file]\batch.rb [Path to file]>other-transcode [Path to file]\batch.rb --add-audio all --add-subtitle all --copy-track-names

Before this I'd just get a blank line. I started getting this after moving the files I want to batch process into the same folder as the script.

For what it's worth I didn't use WSL at all while installing Ruby, which is why I'm confused.

lisamelton commented 3 months ago

@Kerbrer Thanks for opening a new issue!

OK, I'm confused. I'm not sure why you're passing batch.rb as an argument to other-transcode.rb. That's not how it works.

Or is the formatting screwed up in your comment and that's what it looks like you're doing?

Kerbrer commented 3 months ago

@Kerbrer Thanks for opening a new issue!

OK, I'm confused. I'm not sure why you're passing batch.rb as an argument to other-transcode.rb. That's not how it works.

Or is the formatting screwed up in your comment and that's what it looks like you're doing?

More like I tried using other-transcode to see what would happen.

No other-transcode gives me a blank line. With other-transcode gives me a scanning media failed error. Tried specifying the full path for the hell of it. The files specified in the queue are in a separate folder.

Specifying multiple files in the command line itself seems to work, but I don't know how well this will work with 76 files.

image

This is copy-pasted from the wiki: image

lisamelton commented 3 months ago

@Kerbrer I'm sorry, but this doesn't help me understand your problem. Let's start with something simple. Please paste in the exact command line you're using. And format the text as code, otherwise I can't tell what you're doing. All I need to see is just one command that's not working correctly for you. Then we can take it step by step from there. Thanks.

Kerbrer commented 3 months ago

@lisamelton

batch.rb --add-audio all --add-subtitle all --copy-track-names is what should work, but gives me a blank line.

(whoops, fixed a doubling that's not there in the cmdline)

lisamelton commented 3 months ago

@Kerbrer Thanks! OK, where did you install your copy of other-transcode.rb?

(And did you remove the Gem-based version of the old other-transcode tool when you did that?)

Kerbrer commented 3 months ago

@lisamelton

I've only ever installed other-transcode 0.12.0, so... no, I don't think so. Unless the older gem-based version is installed along with 0.12.0?

Currently, my copy is in C:/Ruby32-x64/bin/other-transcode

lisamelton commented 3 months ago

@Kerbrer OK, that means the batch.rb script will not work for you because you don't have other-transcode.rb installed. Instead, you have other-transcode installed. Notice the difference in spelling? The new version has .rb at the end of the name. That's because the new version is a standalone Ruby script.

Please read the latest version of the "README.md" file. In it, you will find this paragraph at the top of the "Installation" section:

[!WARNING] Older versions of this project were packaged via RubyGems and installed via the gem command. If you had it installed that way, it's a good idea to uninstall that version via this command: gem uninstall other_video_transcoding

And following that paragraph, you will see instructions to install the new standalone other-transcode.rb script and put it in a directory listed in your $env:PATH environment variable.

Why is this important?

Because the batch.rb script is calling the new other-transcode.rb script and not the older other-transcode tool.

Does that help?

Kerbrer commented 3 months ago

@lisamelton

It kind of does, but I'm confused as to how this is the older, RubyGems-packaged version when I only downloaded this a month or two ago and git says it was last updated in 2022.

I also swear that when I downloaded other-transcode all of the commands listed didn't actually have .rb.

lisamelton commented 3 months ago

@Kerbrer Look at the "CHANGELOG.md" document. I made this change on Friday, July 5, 2024.

I'm sorry it's caused this problem for you. But RubyGems was becoming a PITA to deal with. It's also easier to iterate on a standalone script.

If you don't want to make this change yet and you still have the Gem installed, then you can simply edit your batch.rb file and change other-transcode.rb to other-transcode.

Does that help?

Kerbrer commented 3 months ago

@lisamelton

Interesting. This is what I see when going to download the latest build. It says 0.12.0 is the latest version. Downloading that again for me just gives me the same Gem-packaged script. image

Trying to download it via git clone https://github.com/lisamelton/other_video_transcoding.git results in an unrecognized command. Should be easy enough to reinstall the Gem version, though, your solution to my specific issue is a pretty good quick fix.

lisamelton commented 3 months ago

@Kerbrer Yes, ignore the "Releases" for now on the GitHub page. I haven't been able to change that yet. In fact, technically, I'm not doing releases that way anymore.

Very likely the reason that git clone ... isn't working for you is that you don't have Git installed. See: https://gitforwindows.org/ to download and install it.

So, can we close this issue now?

Kerbrer commented 3 months ago

@lisamelton Unfortunately I'm still having the exact same problem, and I managed to install the newer script.

batch.rb --copy-track names --add-audio all --add-subtitle all results in the blank line.

other-transcode.rb D:\Movies\bsgrip\S0E01.mkv --copy-track names --add-audio all --add-subtitle all works as it's supposed to.

lisamelton commented 3 months ago

@Kerbrer OK, is other-transcode.rb in a directory listed in your $env:PATH environment variable? Otherwise batch.rb won't find it.

Also, can you paste in the contents (or at least partial contents) of your queue.txt file?

Kerbrer commented 3 months ago

@lisamelton

Okay, it's pretty clear I'm stumbling through this and it's a miracle I've made it this far. I'm not exactly sure how to set the $env:PATH variable. Is #!/usr/bin/env ruby an example of this?

Also, I don't know if this is relevant, but I'm getting C:/Ruby32-x64/bin/other-transcode.rb: scanning media failed: names now after a test transcode.

lisamelton commented 3 months ago

@Kerbrer Do NOT put the other-transcode.rb script into the C:/Ruby32-x64/bin directory or bad things can happen. That's a private directory for Ruby internals and Gem-installed scripts.

You can put the other-transcode.rb script into the same directory as your did with ffmpeg and the other tools.

See the wiki for details on how to do this and setting your $env:PATH variable: https://github.com/lisamelton/other_video_transcoding/wiki/Windows

Kerbrer commented 3 months ago

@lisamelton

Okay, added the $env:PATH variable. Still having problems with it stopping at removing the first line from the queue file and blank line.

here is the command being used: D:\Movies\SmolVidyas\bsg>batch.rb --add-audio all --add-subtitle all --copy-track-names

This is what's in the queue.txt: D:\Movies\bsgrip\S0E01.mkv D:\Movies\bsgrip\S0E02.mkv

When running the batch command, only D:\Movies\bsgrip\S0E02.mkv remains. It stays there after further attempts.

(I'm not going to lie; I thought the wiki tab was for the site in general, not for specific repos. There are days where I'm not particularly bright!)

javacrossknit commented 3 months ago

You might be running into a minor issue related to the way the batch script works. The queue.txt file in your message has only two lines. For the script to process each item, it needs to have a blank line after the final item. So, you need your two entries and a hard return after the second item (for a total of three lines):

D:\Movies\bsgrip\S0E01.mkv
D:\Movies\bsgrip\S0E02.mkv

If you had four items, you’d need a blank fifth line at the end. In other words, your saved queue.txt file always has to end with a blank line.

Kerbrer commented 3 months ago

@lisamelton That didn't seem to be the case. It still removes the first line and stops before actually running the rest of the script.

This queue.txt will go from looking like this:

D:\Movies\bob\BoB01.mkv
D:\Movies\bob\BoB02.mkv
D:\Movies\bob\BoB03.mkv
D:\Movies\bob\BoB04.mkv
D:\Movies\bob\BoB05.mkv
D:\Movies\bob\BoB06.mkv
D:\Movies\bob\BoB07.mkv
D:\Movies\bob\BoB08.mkv
D:\Movies\bob\BoB09.mkv
D:\Movies\bob\BoB10.mkv

to this:

D:\Movies\bob\BoB02.mkv
D:\Movies\bob\BoB03.mkv
D:\Movies\bob\BoB04.mkv
D:\Movies\bob\BoB05.mkv
D:\Movies\bob\BoB06.mkv
D:\Movies\bob\BoB07.mkv
D:\Movies\bob\BoB08.mkv
D:\Movies\bob\BoB09.mkv
D:\Movies\bob\BoB10.mkv