DVD to mp4 batch conversion

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Bacardipur321
Posts: 6
Joined: Mon Feb 01, 2021 1:34 pm

DVD to mp4 batch conversion

Post by Bacardipur321 »

Description of problem or question:
Iam calling the CLI via a "foreach loop" in my C# program. But unfortunately it doesnt work. I always get the error "libhb result = 3".
It would be great if anybody with Handbrake knowledge can give me a hint. ( iam new in this topic so i cannot read the logfiles in a useful manner )

Best regards,
Mathias

HandBrake version (e.g., 1.0.0):
Version is now 1.3.3 (in the pastebin it was an older one i think)

Operating system:
Win10 Pro , Version 20H2

HandBrake Activity Log
https://pastebin.com/ViP4UA0i
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: DVD to mp4 batch conversion

Post by rollin_eng »

Can you try outputting to a different directory?
Bacardipur321
Posts: 6
Joined: Mon Feb 01, 2021 1:34 pm

Re: DVD to mp4 batch conversion

Post by Bacardipur321 »

I tried another directory on drive D:. Same result :(
Deleted User 11865

Re: DVD to mp4 batch conversion

Post by Deleted User 11865 »

Make sure the directory exists first. And maybe avoid special characters like '#'…
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: DVD to mp4 batch conversion

Post by rollin_eng »

Maybe even try a different drive.
Bacardipur321
Posts: 6
Joined: Mon Feb 01, 2021 1:34 pm

Re: DVD to mp4 batch conversion

Post by Bacardipur321 »

Rodeo wrote: Mon Feb 01, 2021 6:01 pm Make sure the directory exists first. And maybe avoid special characters like '#'…
I checked both.
- Directory exists : YES
- Changed foldernames to avoid special signs: YES

Maybe there is some implementation problem in the call of the CLI.exe from the C# tool. I will check this tomorow...
If anybody is interested here a small code snippet

Code: Select all

System.Diagnostics.Process process = new System.Diagnostics.Process();
            ProcessStartInfo info = new ProcessStartInfo(textBoxHandbrakeCLI.Text);

            process.StartInfo = info;
            
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.CreateNoWindow = false;
            //process.StartInfo.RedirectStandardInput = true;
            process.StartInfo.RedirectStandardOutput = true;
            //process.StartInfo.RedirectStandardError = true;

            foreach (var clip in validMediaFiles)
            {
                List<string> args = new List<string>() { clip.Key, clip.Value , textBoxJsonSetting.Text };

                process.StartInfo.Arguments = "";

                process.StartInfo.Arguments += " -i";
                process.StartInfo.Arguments += " \"" + clip.Key + "\""; 
                process.StartInfo.Arguments += " -o";
                process.StartInfo.Arguments += " \"" + clip.Value + "\"";
                process.StartInfo.Arguments += " \"" + textBoxJsonSetting.Text + "\"";

                //Start process
                process.Start();
                //Print Filepath and Arguments
                Console.WriteLine(process.StartInfo.FileName + process.StartInfo.Arguments);
                process.WaitForExit();
                process.Close();
            }
Bacardipur321
Posts: 6
Joined: Mon Feb 01, 2021 1:34 pm

Re: DVD to mp4 batch conversion

Post by Bacardipur321 »

rollin_eng wrote: Mon Feb 01, 2021 6:05 pm Maybe even try a different drive.
Already tried another drive. Folders are not write protected and no special signs ...
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: DVD to mp4 batch conversion

Post by rollin_eng »

Can you post your new log.

Also try making sure your source directory has no special characters.
Bacardipur321
Posts: 6
Joined: Mon Feb 01, 2021 1:34 pm

Re: DVD to mp4 batch conversion

Post by Bacardipur321 »

rollin_eng wrote: Mon Feb 01, 2021 6:10 pm Can you post your new log.

Also try making sure your source directory has no special characters.
https://pastebin.com/WnEEXs0H
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: DVD to mp4 batch conversion

Post by rollin_eng »

I still think it’s a write/permission problem, can you output to the desktop?
Bacardipur321
Posts: 6
Joined: Mon Feb 01, 2021 1:34 pm

Re: DVD to mp4 batch conversion

Post by Bacardipur321 »

rollin_eng wrote: Mon Feb 01, 2021 7:43 pm I still think it’s a write/permission problem, can you output to the desktop?
You are right. I just printed everything step by step again and i saw that the destination folder is available but the sub-destination folder was missing.
Thanks to your input it is converting now. Thank you very much. If its more stable i can post the repo here if anybody is interested..
Deleted User 13735

Re: DVD to mp4 batch conversion

Post by Deleted User 13735 »

@rollin_eng
Good call!
Post Reply