private void ConfigPlaylist()
        {
            MItem myBack;

            m_objMPLaylist.PlaylistBackgroundSet(null, "", "", out myBack);
            if (myBack != null)
            {
                System.Runtime.InteropServices.Marshal.ReleaseComObject(myBack);
                GC.Collect();
            }
            // set convert format
            M_VID_PROPS mvid;
            M_AUD_PROPS maud;
            int         fmtind;
            string      fmtname;

            m_objMPLaylist.FormatVideoGet(eMFormatType.eMFT_Output, out mvid, out fmtind, out fmtname);
            m_objMPLaylist.FormatAudioGet(eMFormatType.eMFT_Output, out maud, out fmtind, out fmtname);
            m_objMPLaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref mvid);
            m_objMPLaylist.FormatAudioSet(eMFormatType.eMFT_Convert, ref maud);

            // set properties
            m_objMPLaylist.PropsSet("loop", "false");
            m_objMPLaylist.PropsSet("active_frc", "false");
            m_objMPLaylist.PropsSet("preview.drop_frames", "true");

            M_VID_PROPS vidProps = new M_VID_PROPS();

            vidProps.eVideoFormat = eMVideoFormat.eMVF_Custom;
            m_objMPLaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps);
        }
Example #2
0
        /// <summary>
        /// Fill video formats list
        /// </summary>
        private void FillVideoFormats()
        {
            int         nCount = 0;
            int         nIndex;
            string      strFormat;
            M_VID_PROPS vidProps;

            comboBoxVF.Items.Clear();
            //Get video format count
            m_objPlaylist.FormatVideoGetCount(eMFormatType.eMFT_Convert, out nCount);
            comboBoxVF.Enabled = nCount > 0;
            if (nCount > 0)
            {
                for (int i = 0; i < nCount; i++)
                {
                    //Get format by index
                    m_objPlaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, i, out vidProps, out strFormat);
                    if (vidProps.eVideoFormat == eMVideoFormat.eMVF_HD1080_5994i)
                    {
                        startVideoFormat = i;
                    }
                    comboBoxVF.Items.Add(strFormat);
                }
                //Check if there is selected format
                m_objPlaylist.FormatVideoGet(eMFormatType.eMFT_Convert, out vidProps, out nIndex, out strFormat);
                if (nIndex > 0)
                {
                    comboBoxVF.SelectedIndex = nIndex;
                }
                else
                {
                    comboBoxVF.SelectedIndex = 0;
                }
            }
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Start();
            //Set and enable a preview,bunları her projede yaz
            myPlaylist.PreviewWindowSet("", panel1.Handle.ToInt32());
            myPlaylist.PreviewEnable("", 1, 1);
            myPlaylist.PropsSet("loop", "false");
            //Start mFile object
            myPlaylist.ObjectStart(new object());
            //Fill video formats
            int         nCount;
            int         nIndex;
            string      strFormat;
            M_VID_PROPS vidProps;

            comboBox1.Items.Clear();
            //Get video format count
            myPlaylist.FormatVideoGetCount(eMFormatType.eMFT_Convert, out nCount);
            comboBox1.Enabled = nCount > 0;
            if (nCount <= 0)
            {
                return;
            }
            for (int i = 0; i < nCount; i++)
            {
                //Get format by index
                myPlaylist.FormatVideoGetByIndex(eMFormatType.eMFT_Convert, i, out vidProps, out strFormat);
                comboBox1.Items.Add(strFormat);
            }
            //Check if there is selected format
            myPlaylist.FormatVideoGet(eMFormatType.eMFT_Convert, out vidProps, out nIndex, out strFormat);
            comboBox1.SelectedIndex = nIndex > 0 ? nIndex : 0;
            //Fill audio formats
            M_AUD_PROPS audProps;

            comboBox2.Items.Clear();
            //Get video format count
            myPlaylist.FormatAudioGetCount(eMFormatType.eMFT_Convert, out nCount);
            comboBox2.Enabled = nCount > 0;
            if (nCount <= 0)
            {
                return;
            }
            for (int i = 0; i < nCount; i++)
            {
                //Get format by index
                myPlaylist.FormatAudioGetByIndex(eMFormatType.eMFT_Convert, i, out audProps, out strFormat);
                comboBox2.Items.Add(strFormat);
            }
            //Check if there is selected format
            myPlaylist.FormatAudioGet(eMFormatType.eMFT_Convert, out audProps, out nIndex, out strFormat);
            comboBox2.SelectedIndex = nIndex > 0 ? nIndex : 0;
            //set audio volume
            trackBar1.Value = 50;
            double dblPos = (double)trackBar1.Value / trackBar1.Maximum;

            myPlaylist.PreviewAudioVolumeSet("", -1, -30 * (1 - dblPos));
        }
        private void buttonHTMLProps_Click(object sender, EventArgs e)
        {
            M_VID_PROPS vProps = new M_VID_PROPS();
            int         idx;
            string      strName;

            m_objPlaylist.FormatVideoGet(eMFormatType.eMFT_Convert, out vProps, out idx, out strName);
            OverlayHTMLWindow overlayHTMLWind = new OverlayHTMLWindow(m_objOverlayHTML, m_objPlaylist, vProps);

            if (overlayHTMLWind.m_bStateOk)
            {
                overlayHTMLWind.ShowDialog();
            }

            string strCurrURL;

            m_objOverlayHTML.PropsGet("current_url", out strCurrURL);

            if (strCurrURL != null)
            {
                textBoxHTMLURL.Text = strCurrURL.Contains("demo.html") ? "demo" : strCurrURL;
            }
        }
Example #5
0
        void StartBug()
        {
            // playlist initialization

            M_VID_PROPS vidProps = new M_VID_PROPS();

            vidProps.eVideoFormat = eMVideoFormat.eMVF_Custom;
            MPlaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps);
            M_AUD_PROPS audioProp = new M_AUD_PROPS();

            audioProp.nChannels = 0;   //because some writer codecs (such as mp3) do not support 16 audio channels.
            MPlaylist.FormatAudioSet(eMFormatType.eMFT_Convert, audioProp);

            // playlist cue
            //set empty background. In this case playlist doesn't output anything until playback isn't started.
            MItem myBack;

            MPlaylist.PlaylistBackgroundSet(null, "", "", out myBack);
            if (myBack != null)
            {
                System.Runtime.InteropServices.Marshal.ReleaseComObject(myBack);
                GC.Collect();
            }
            // set convert format
            M_VID_PROPS mvid;
            M_AUD_PROPS maud;
            int         fmtind;
            string      fmtname;

            MPlaylist.FormatVideoGet(eMFormatType.eMFT_Output, out mvid, out fmtind, out fmtname);
            MPlaylist.FormatAudioGet(eMFormatType.eMFT_Output, out maud, out fmtind, out fmtname);
            MPlaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref mvid);
            MPlaylist.FormatAudioSet(eMFormatType.eMFT_Convert, ref maud);
            // set properties
            MPlaylist.PropsSet("loop", "false");
            MPlaylist.PropsSet("active_frc", "false");
            MPlaylist.PropsSet("preview.drop_frames", "true");
            vidProps.eVideoFormat = eMVideoFormat.eMVF_Custom;
            MPlaylist.FormatVideoSet(eMFormatType.eMFT_Convert, ref vidProps);

            int   index = -1;
            MItem item;

            MPlaylist.PlaylistAdd(null, @"\\192.168.0.100\MLFiles\Trash\Roman\WorkFiles\FilesFromCostumer\2019.05.27 Etere31929\kom_mult_kosmik_007sh_s.mpg", "", ref index, out item);

            // writer properties
            MWriter.PropsSet("rate_control", "true");
            MWriter.PropsSet("pull_mode", "false");
            MWriter.PropsSet("external_process", "false");

            //set audio mapping on first 2 channels only
            string       desc;
            IMAudioTrack audioTrack;

            MPlaylist.AudioTrackGetByIndex(0, out desc, out audioTrack);

            int nChIn;
            int nChOutIdx;
            int nChOut;

            audioTrack.TrackChannelsGet(out nChIn, out nChOutIdx, out nChOut);
            for (int i = 0; i < nChOut; i++)
            {
                int mute;
                if (i < 2)
                {
                    // switch on the required audio channels
                    mute = 0;
                }
                else
                {
                    // set mute all other audio channels
                    mute = 1;
                }
                audioTrack.TrackMuteSet(i, mute, 0.0);
            }

            string encodeConfig = @"format='mp4' start_timecode='00:00:00:00' video::codec='q264sw' video::size='640x360' video::b='1M' video::minrate='1M' video::maxrate='1M' video::ar='' video::ref_frames='3' video::profile='Baseline' video::level='4.1' video::rc_type='cbr' audio::codec='aac' audio::ar='48000'";

            MWriter.WriterNameSet(@"\\192.168.0.100\MLFiles\Trash\Roman\WorkFiles\FilesFromCostumer\2019.05.27 Etere31929\test\" + count.ToString() + ".mp4", encodeConfig);
            MWriter.ObjectStart(MPlaylist);
            MPlaylist.FilePlayStart();

            Marshal.ReleaseComObject(item);
            //Marshal.ReleaseComObject(myBack);
            GC.Collect();
        }