private void FillAudioFormats() { int nCount = 0; int nIndex; string strFormat; M_AUD_PROPS audProps; comboBoxAF.Items.Clear(); m_objFile.FormatAudioGetCount(eMFormatType.eMFT_Convert, out nCount); comboBoxAF.Enabled = nCount > 0; if (nCount > 0) { for (int i = 0; i < nCount; i++) { m_objFile.FormatAudioGetByIndex(eMFormatType.eMFT_Convert, i, out audProps, out strFormat); if (audProps.nBitsPerSample == 16 && audProps.nChannels == 16 && audProps.nSamplesPerSec == 48000) { startAudioFormat = i; } comboBoxAF.Items.Add(strFormat); } m_objFile.FormatAudioGet(eMFormatType.eMFT_Convert, out audProps, out nIndex, out strFormat); if (nIndex > 0) { comboBoxAF.SelectedIndex = nIndex; } else { comboBoxAF.SelectedIndex = 0; } } }
private void Start_btn_Click(object sender, EventArgs e) { //int nIndex = -1; //MItem pFile; //m_objPlaylist.PropsSet("loop", "false"); //m_objPlaylist.PropsSet("active_frc", "false"); //m_objPlaylist.PropsSet("preview.drop_frames", "true"); //m_objPlaylist.PlaylistAdd(null, openFile_txb.Text, "external_process=false experimental.mfcodecs=true experimental.out_video_packets=true", ref nIndex, out pFile); // //m_objPlaylist.FilePlayStart(); int index; string name; M_AUD_PROPS propsA; m_objFile.FormatAudioGet(eMFormatType.eMFT_Input, out propsA, out index, out name); propsA.nChannels = 8; m_objFile.PropsSet("active_frc", "false"); m_objFile.PropsSet("preview.drop_frames", "true"); m_objFile.FileNameSet(openFile_txb.Text, "");//"external_process=false experimental.mfcodecs=true experimental.out_video_packets=true"); //m_objFile.FileNameSet(openFile_txb.Text, ""); //(m_objFile as IMProps).PropsSet("object::audio_channels", "0,1,2,3,4,5,6,7"); m_objFile.FormatAudioSet(eMFormatType.eMFT_Convert, ref propsA); m_objFile.FilePlayStart(); m_objWriter.PropsSet("external_process", "false"); m_objWriter.PropsSet("rate_control", "true"); m_objWriter.PropsSet("pull_mode", "false"); m_objWriter.FormatAudioSet(eMFormatType.eMFT_Convert, ref propsA); //m_objWriter.WriterNameSet(savePath_txb.Text, "format='mp4' video::codec='packets' audio::codec='audio_packets'"); m_objWriter.WriterNameSet(savePath_txb.Text, "format='mp4' video::codec='n264' audio::codec='aac'"); m_objWriter.ObjectStart(m_objFile); }