2

I wanted to transcode a video with simple Windows Forms program.

I'm creating process with arguments.

My code:

        string vlc = @"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe";
        string dest=@"C:\Users\pc\Desktop\test.mp4";

        ProcessStartInfo p = new ProcessStartInfo
        {
            FileName = vlc,
            Arguments = @"% vlc C:/video.mpg :sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:std{access=file{no-overwrite},mux=mp4,dst="+dest+"}"
        };
        Process x = Process.Start(p);
        x.WaitForExit();

The problem is that it not working. The program launches VLC and there's nothing happening or getting errors from VLC

Rafał Belski
  • 43
  • 1
  • 9
  • You forgot to add your question, assuming you have one. – stuartd Sep 12 '16 at 15:47
  • Ah, yes. The problem is that it not work (question updated) – Rafał Belski Sep 12 '16 at 17:09
  • 1
    have you tried the sout chain of parameters within VLC or via command line? Also, try to enable logging by using verbose mode -vvv , it will tell you enough to dig deeper. You should also be able to view the log via the interface. Generally try to first make it work with VLC and then work from there... – Mike F Sep 26 '16 at 08:35

1 Answers1

1

I recently asked a Similar Question,

If you want to see the Generated Stream Output String, Use Open Network Stream and change your tab to File.

Instead of clicking Play, expand the drop down to choose Stream.

Follow the Wizard directions to set up your destination File and transcoding Options.

Before streaming you will get the string that you can use....

For example:

:sout=#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100}:file{dst=C:\\Users\\Public\\Videos\\Sample Videos\\test.mp4,no-overwrite} :sout-keep
gtgaxiola
  • 9,241
  • 5
  • 42
  • 64