Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
Questionusing Vmware SDK in C# Pin
Biju Krishnan30-Oct-13 19:50
Biju Krishnan30-Oct-13 19:50 
AnswerRe: using Vmware SDK in C# Pin
Dave Kreskowiak31-Oct-13 1:50
mveDave Kreskowiak31-Oct-13 1:50 
AnswerRe: using Vmware SDK in C# Pin
Abhinav S31-Oct-13 7:08
Abhinav S31-Oct-13 7:08 
QuestionGet User Name and Photograph from Twitter using Azure Mobile Service Pin
Abhiroop0930-Oct-13 18:34
Abhiroop0930-Oct-13 18:34 
SuggestionRe: Get User Name and Photograph from Twitter using Azure Mobile Service Pin
Richard MacCutchan30-Oct-13 22:03
mveRichard MacCutchan30-Oct-13 22:03 
QuestionWhat is IServiceProvider? Pin
Member 1030956730-Oct-13 10:31
Member 1030956730-Oct-13 10:31 
AnswerRe: What is IServiceProvider? PinPopular
Ron Beyer30-Oct-13 10:54
professionalRon Beyer30-Oct-13 10:54 
QuestionHow to use DirectX.Capture to capture webcam stream into a .mp4(mpeg4) in c#? Pin
Member 1035824430-Oct-13 9:41
Member 1035824430-Oct-13 9:41 
I tried to capture webcam video into a mp4 file using the following code.

void preview(int deviceNo, string filename)
{
try
{
capture = new Capture(filters.VideoInputDevices[deviceNo], filters.AudioInputDevices[0]);
//capture.FrameSize = new Size(320, 240);
//capture.FrameRate = 30;

//capture.VideoCompressor = filters.VideoCompressors[0];
//capture.AudioCompressor = filters.AudioCompressors[0];

capture.FrameRate = 29.997; // NTSC
capture.FrameSize = new Size( 320, 240 ); // 640x480
capture.AudioSamplingRate = 44100; // 44.1 kHz

//capture.AudioSampleSize = 16; // 16-bit
//capture.AudioChannels = 1; // Mono

// capture.Filename = "C:\MyVideo.avi";



capture.PreviewWindow = panel1;

if (btnStartVideoCapture.Text == "STOP")
{
counter++;
if (!capture.Cued) capture.Filename = filename + ".mp4";
capture.Cue();
}

capture.Start();
panel1.Visible = false;

}
catch {}
}

/*============================================================================*/

private void btnStartVideoCapture_Click(object sender, EventArgs e)
{
startOrStopCapturing(capture,filename);
}

/*============================================================================*/

void startOrStopCapturing(Capture capture, string filename)
{
btnStartVideoCapture.Visible = false;

if (capture != null) capture.Stop();
if (timer.Enabled) timer.Stop();

if (btnStartVideoCapture.Text == "START")
{
btnStartVideoCapture.Text = "STOP";
btnStartVideoCapture.BackColor = Color.Maroon;
panel1.Visible = true;
try
{
if (!capture.Cued) capture.Filename = filename + ".mp4";

capture.Cue();
capture.Start();

timer.Start();
}
catch (Exception ex)
{
MessageBox.Show("Error Message: \n\n" + ex.Message);
}
}
else
{
btnStartVideoCapture.Text = "START";
btnStartVideoCapture.BackColor = Color.DarkSlateBlue;
panel1.Visible = false;
}
btnStartVideoCapture.Visible = true;
}

although the file is saved as mp4, but android still cannot play it. When I open meta info of the file, it is still an avi format file. Does anyone know how to save it as a mp4 file?

Here is the info of the file save as mp4 extension but has avi format

General
Complete name : C:\Recorder\bin\Debug\test.mp4
Format : AVI
Format/Info : Audio Video Interleave
File size : 2.62 MiB
Duration : 9s 72ms
Overall bit rate : 2 422 Kbps

Video
ID : 0
Format : Cinepack
Codec ID : cvid
Duration : 7s 533ms
Bit rate : 1 889 Kbps
Width : 320 pixels
Height : 240 pixels
Display aspect ratio : 4:3
Frame rate : 30.000 fps
Bits/(Pixel*Frame) : 0.820
Stream size : 1.70 MiB (65%)

Audio
ID : 1
Format : ADPCM
Format profile : A-Law
Codec ID : 6
Codec ID/Hint : CCITT
Duration : 9s 72ms
Bit rate mode : Constant
Bit rate : 705.6 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Bit depth : 8 bits
Stream size : 781 KiB (29%)
Interleave, duration : 204 ms (6.11 video frames)
Interleave, preload duration : 500 ms
Thanks,
Peter
AnswerRe: How to use DirectX.Capture to capture webcam stream into a .mp4(mpeg4) in c#? Pin
Bernhard Hiller31-Oct-13 1:25
Bernhard Hiller31-Oct-13 1:25 
QuestionEditing Word Pin
Sandeepdshenoy30-Oct-13 0:58
Sandeepdshenoy30-Oct-13 0:58 
AnswerRe: Editing Word Pin
BillWoodruff30-Oct-13 1:20
professionalBillWoodruff30-Oct-13 1:20 
AnswerRe: Editing Word Pin
Chris Quinn30-Oct-13 3:09
Chris Quinn30-Oct-13 3:09 
AnswerRe: Editing Word Pin
WuRunZhe30-Oct-13 4:12
WuRunZhe30-Oct-13 4:12 
GeneralRe: Editing Word Pin
Sandeepdshenoy30-Oct-13 21:37
Sandeepdshenoy30-Oct-13 21:37 
AnswerRe: Editing Word Pin
Eddy Vluggen1-Nov-13 6:00
professionalEddy Vluggen1-Nov-13 6:00 
GeneralRe: Editing Word Pin
Sandeepdshenoy30-Oct-13 21:42
Sandeepdshenoy30-Oct-13 21:42 
AnswerRe: Editing Word Pin
Kenneth Haugland30-Oct-13 21:31
mvaKenneth Haugland30-Oct-13 21:31 
QuestionIssue with Excel vesion in C# Pin
superselector29-Oct-13 19:05
superselector29-Oct-13 19:05 
AnswerRe: Issue with Excel vesion in C# Pin
Mycroft Holmes29-Oct-13 20:11
professionalMycroft Holmes29-Oct-13 20:11 
GeneralRe: Issue with Excel vesion in C# Pin
Kenneth Haugland29-Oct-13 20:30
mvaKenneth Haugland29-Oct-13 20:30 
GeneralRe: Issue with Excel vesion in C# Pin
Mycroft Holmes29-Oct-13 21:16
professionalMycroft Holmes29-Oct-13 21:16 
GeneralRe: Issue with Excel vesion in C# Pin
Kenneth Haugland29-Oct-13 21:25
mvaKenneth Haugland29-Oct-13 21:25 
GeneralRe: Issue with Excel vesion in C# Pin
superselector30-Oct-13 18:42
superselector30-Oct-13 18:42 
AnswerRe: Issue with Excel vesion in C# Pin
Kenneth Haugland30-Oct-13 21:29
mvaKenneth Haugland30-Oct-13 21:29 
AnswerRe: Issue with Excel vesion in C# Pin
Bernhard Hiller29-Oct-13 21:39
Bernhard Hiller29-Oct-13 21:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.