JMoVS / installing_video_transcoding_on_windows

Installing Don Melton's excellent video_transcoding scripts on Windows
32 stars 3 forks source link

Help with mpv #12

Closed hilldw11 closed 6 years ago

hilldw11 commented 6 years ago

In the last bit of instructions MPV has to be downloaded and the files extracted to c:/bin. I have completed this and attempted this instruction:

Create an alias for mpv: echo "alias mpv=mpv.exe" >> .bashrc

Is there supposed to be a response once that is typed in?

mpv

The reason I am asking is this is the result I get when I try to use detect-crop:

hhhh@DESKTOP-BIO:/mnt/c/Users/name$ detect-crop "/videos/suicide_squad/suicide_squad.mkv" /var/lib/gems/2.3.0/gems/video_transcoding-0.18.0/lib/video_transcoding/tool.rb:33: warning: Insecure world writable dir /mnt/c/ProgramData/Oracle/Java in PATH, mode 040777 /usr/local/bin/detect-crop: No such file or directory @ rb_file_s_stat - /videos/suicide_squad/suicide_squad.mkv

I am new to command line so perhaps i am inputting something incorrectly.

Thanks for the help.

samhutchins commented 6 years ago

To get the mpv alias to take effect you need to either restart Bash or run source ~/.bashrc. I’m sorry that’s not clear, I’ll amend that in the instructions.

The warnings about insecure world writable directories in the path are normal

It looks like you’re getting the no such file or directory error because the path to the file is incorrect. You probably don’t need to put the / at the beginning of the path

hilldw11 commented 6 years ago

Thank you for the quick response, I appreciate the help. I restarted bash and then tried to run detect-crop again without the / at the beginning of the path and got the same response. Is there a better place to put the original mkv file than in c:/users/username/videos/ ?

thanks again

JMoVS commented 6 years ago

Hi @hilldw11 , no worries, we were all new to the command line at some point. ;-)

What will help get you going is using autocomplete I think. The / was a nice guess, but a / at the beginning indicates the root folder on Unix systems, which we don't want in this case. It looks like you successfully navigated to the path /mnt/c/Users/name - what you can do there is then type your detect-crop but then continue with a space and type a vid and then hit the tab-key once or twice. If Windows' linux bash is similar enough, it should autocomplete to videos, where you can then type suic (alas, the first couple of letters) and hit tab again. This will make sure all characters that need to be escsaped are automatically escaped.

Hope this helps!, if not, let us know!

hilldw11 commented 6 years ago

Unfortunately your suggestion didn't fix the issue. I decided to try and start over. I think I have it working now but it needs an adjustment regarding the permissions. This is what I got when i used detect-crop

hilldw@DESKTOP-BIO8:/mnt/c/Users/UserName$ detect-crop "Videos/Suicide_Squad/Suicide_Squad.mkv" /var/lib/gems/2.3.0/gems/video_transcoding-0.18.0/lib/video_transcoding/tool.rb:33: warning: Insecure world writable dir /mnt/c/ProgramData/Oracle/Java in PATH, mode 040777 ... ...

mpv --no-audio --vf "lavfi=[drawbox=0:140:1920:800:invert:1]" Videos/Suicide_Squad/Suicide_Squad.mkv mpv --no-audio --vf crop=1920:800:0:140 Videos/Suicide_Squad/Suicide_Squad.mkv

transcode-video --crop 140:140:0:0 Videos/Suicide_Squad/Suicide_Squad.mkv

While I get the same error message, I actually get proper output from the function.

I found this thread https://github.com/donmelton/video_transcoding/issues/70 where the OP seems to have a similar issue. Mr. Metlon ask the OP about his permissions, when I look at mine I don't think they are what they should be: drwxr-xr-x 0 root root 512 Sep 22 12:12 /usr/local

The suggestion to fix this is:

sudo chown YOUR_USERNAME_HERE /usr/local sudo chgrp admin /usr/local sudo chmod 775 /usr/local

is YOUR_USERNAME_HERE supposed to be the username I use on my computer or the username I have for linux?

thanks again

samhutchins commented 6 years ago

The warnings are emitted by Ruby, not the video_transcoding tool, and they're because of the way permissions are translated between Windows paths and Linux paths.

The warning is: Insecure world writable dir /mnt/c/ProgramData/Oracle/Java in PATH. You'll notice it's warning you about your Java installation directory, not /usr/local. The commands Don listed are for correcting permissions for /usr/local on macOS, so I don't think you should run them on Bash on Windows.

My installation displays exactly the same warning, and I've not yet seen a way to silence it.

The detect-crop command you ran completed correctly, it's suggesting a crop of 140:140:0:0, so if you ran transcode-video --crop 140:140:0:0 Videos/Suicide_Squad/Suicide_Squad.mkv I would expect it to work, albeit with the same warning at the start. That won't affect the transcode though

JMoVS commented 6 years ago

@samhutchins Well, if you want to get rid of it (and don't need to run java from bash), have a look if it's inside bashrc as a valid path (the path would be to /mnt/c/ProgramData or further down that way). If you remove it there and reload/source it, it should then no longer see that as path and therefore no longer complain. Did you check /etc/environment and what kind of PATHs are listed there?

@hilldw11 sam is correct, everything should work feature wise now as is

samhutchins commented 6 years ago

@JMoVS The Windows $PATH is prepended before .bashrc is called. I've not looked at /etc/environment. I might do some more digging to try and deal with it, but if you remove the Windows $PATH you have to use the full path to Windows executables to launch them, and I don't wanna make that assumption for someone.

JMoVS commented 6 years ago

@samhutchins Valid argument indeed. Well then, I guess we live with that error for now ;-)

hilldw11 commented 6 years ago

Thanks for the help guys, I am up and running now.

Youtube videos on the install and running the basic features of video_transcode would be pretty invaluable to beginners like myself.

hilldw11 commented 6 years ago

In my OP, I misdiagnosed my problem with detect-crop as an issue with mpv . As @samhutchins pointed out, my problem was actually with not entering the correct path. Now that I have worked with detect-crop and transcode-video a bit more I understand my mistake.

I'm not able to preview the suggested cropping with mpv as I am still get the following message: The program 'mpv' is currently not installed. You can install it by typing: sudo apt install mpv

Here are the extracted files for mpv in c:/bin

capture

and here is c:/bin added to the path: capture1

do you guys have any thoughts on where I might have erred in the installation of mpv? Thanks for the help....again.

samhutchins commented 6 years ago

Did you add the mpv alias?

  1. echo "alias mpv=mpv.exe" >> ~/.bashrc
  2. source ~/.bashrc
hilldw11 commented 6 years ago

@samhutchins yes, I did add the mpv alias. Do you have to navigate to a specific path and run bash in that location before adding the alias? Does it look like I added the path correctly to the system variables?

JMoVS commented 6 years ago

Run „source .bashrc“ once just to make sure your terminal picked up the alias. Hope that helps!

Beste Grüße Justin Scholz

Sent from mobile

Am 28.01.2018 um 07:10 schrieb hilldw11 notifications@github.com:

@samhutchins yes, I did add the mpv alias. Do you have to navigate to a specific path and run bash in that location before adding the alias? Does it look like I added the path correctly to the system variables?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

hilldw11 commented 6 years ago

got it.... I had to edit the .bashrc file. I forgot that when I was going through the installation process I left the s off alias. I incorrectly assumed that as i misspelled it i could type the line in again correctly and everything would work out. live and learn. thanks for the help.

JMoVS commented 6 years ago

Thx for the follow-up. Happy transcoding!