BrianDMG / conv2mp4

This Powershell script will recursively search through a user-defined file path and convert all videos of user-specified file types to MP4 with H264 video and AAC audio using ffmpeg. The purpose of this script is to reduce transcoding CPU load on a media server like Plex or Emby and increase video compatibility across platforms.
129 stars 23 forks source link

Multiple errors when running latest version of script. #54

Closed mke9m closed 4 years ago

mke9m commented 4 years ago

The below error's are presented when attempting to convert any files.

`ConvertFile : Cannot process argument transformation on parameter 'KeepSubs'. Cannot convert value "System.String" to type "System.Management.Automation.SwitchParameter". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. At C:\Scripts\FFMPEG\conv2mp4-ps-master\conv2mp4-ps.ps1:104 char:54

cmd.exe : '-i' is not recognized as an internal or external command, At C:\Scripts\FFMPEG\conv2mp4-ps-master\files\func\GetAudioStreams.ps1:11 char:33

operable program or batch file. Cannot index into a null array. At C:\Scripts\FFMPEG\conv2mp4-ps-master\files\func\GetAudioStreams.ps1:14 char:9

BrianDMG commented 4 years ago

Can you paste the value you have in your config for keep_subtitles?

mke9m commented 4 years ago

sure thing.

Subtitle options

keep_subtitles= true

BrianDMG commented 4 years ago

What version of Powershell are you using? ($PSVersionTable.PSVersion)

mke9m commented 4 years ago

I am using;

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      17134  228  
BrianDMG commented 4 years ago

On line 83 of conv2mp4-ps.ps1, can you add (as a single line) Log "keep_subtitles: $($cfg.keep_subtitles), type: $($cfg.keep_subtitles.gettype().Name)" and rerun the script, then paste the output (from your log) here?

Edited for formatting

mke9m commented 4 years ago

After looking at the config file closely I noticed that I must have converted it to a txt file at some point. After deleting the file then creating a new one from the config template it is now working.

I am still receiving the error

cmd.exe : '-i' is not recognized as an internal or external command, At C:\Scripts\FFMPEG\conv2mp4-ps-master\files\func\GetAudioStreams.ps1:11 char:33

operable program or batch file. Cannot index into a null array. At C:\Scripts\FFMPEG\conv2mp4-ps-master\files\func\GetAudioStreams.ps1:14 char:9

The getaudiostreams file is unchanged

BrianDMG commented 4 years ago

Found a bug after doing a little testing on my end, pushed a fix to the develop branch. Switch over to develop, run git pull, and let me know if the issue persists.

BrianDMG commented 4 years ago

Assuming the issue is resolved. Feel free to reopen if that's not the case.