Beispiel #1
0
        private async Task <FFmpegInteropMSS> CreateMediaSourceAndPlayer(MediaPlayerElement playerElement, FFmpegInteropMSS ffmpegMss, Clip clip)
        {
            if (ffmpegMss != null)
            {
                ffmpegMss.Dispose();
            }

            FFmpegInteropConfig conf = new FFmpegInteropConfig();

            conf.StreamBufferSize = BufferSizeInBytes;

            MediaPlayer player = playerElement.MediaPlayer;

            if (player == null)
            {
                player = CreatePlayer();
            }

            using (var stream = await clip.ClipFile.OpenAsync(Windows.Storage.FileAccessMode.Read))
            {
                ffmpegMss = await FFmpegInteropMSS.CreateFromStreamAsync(stream, conf);
            }

            player.Source = ffmpegMss.CreateMediaPlaybackItem();
            playerElement.SetMediaPlayer(player);

            return(ffmpegMss);
        }
Beispiel #2
0
        public MainPage()
        {
            Config = new FFmpegInteropConfig();

            this.InitializeComponent();

            // Show the control panel on startup so user can start opening media
            Splitter.IsPaneOpen      = true;
            AutoDetect.IsOn          = true;
            VideoEffectConfiguration = new VideoEffectConfiguration();

            mediaPlayer = new MediaPlayer();
            mediaPlayer.AudioCategory = MediaPlayerAudioCategory.Movie;
            mediaPlayer.MediaOpened  += MediaPlayer_MediaOpened;
            mediaPlayer.MediaFailed  += MediaPlayer_MediaFailed;
            mediaPlayerElement.SetMediaPlayer(mediaPlayer);

            // optionally check for recommended ffmpeg version
            //FFmpegVersionInfo.CheckRecommendedVersion();

            CodecChecker.CodecRequired += CodecChecker_CodecRequired;

            // populate character encodings
            cbEncodings.ItemsSource = CharacterEncoding.GetCharacterEncodings();

            CoreWindow.GetForCurrentThread().KeyDown += MainPage_KeyDown;
        }
Beispiel #3
0
        public MainPage()
        {
            Config = new FFmpegInteropConfig();

            this.InitializeComponent();

            // Show the control panel on startup so user can start opening media
            Splitter.IsPaneOpen = true;
        }
Beispiel #4
0
 //static readonly bool FFmpegPassthroughAudioMP3 = false;
 //static readonly bool FFmpegPassthroughAudioAAC = false;
 //static readonly bool FFmpegPassthroughVideoH264 = true;
 //static readonly bool FFmpegPassthroughVideoH264Hi10P = false;
 //static readonly bool FFmpegPassthroughVideoHEVC = false;
 //static readonly bool FFmpegVideoOutputAllowIyuv = false;
 public static void CreateConfig()
 {
     FFmpegConfig = new FFmpegInteropConfig
     {
         //PassthroughAudioAAC = FFmpegPassthroughAudioAAC,
         //PassthroughAudioMP3 = FFmpegPassthroughAudioMP3,
         //PassthroughVideoH264 = FFmpegPassthroughVideoH264,
         //PassthroughVideoH264Hi10P = FFmpegPassthroughVideoH264Hi10P,
         //PassthroughVideoHEVC = FFmpegPassthroughVideoHEVC,
         //VideoOutputAllowIyuv = FFmpegVideoOutputAllowIyuv
     };
 }
Beispiel #5
0
        public MainPage()
        {
            Config = new FFmpegInteropConfig();

            this.InitializeComponent();

            // Show the control panel on startup so user can start opening media
            Splitter.IsPaneOpen = true;

            // optionally check for recommended ffmpeg version
            FFmpegVersionInfo.CheckRecommendedVersion();
        }
Beispiel #6
0
        public MainPage()
        {
            Config = new FFmpegInteropConfig();
            Config.DefaultBufferTimeUri = TimeSpan.FromMilliseconds(50);
            Config.StreamBufferSize     = 0;
            Config.FFmpegOptions.Add("stimeout", 100000);
            Config.FFmpegOptions.Add("rtsp_transport", "udp");
            Config.FFmpegOptions.Add("reorder_queue_size", 64);
            //Config.FFmpegOptions.Add("packet-buffering", 0);
            //Config.FFmpegOptions.Add("fflags", "nobuffer");
            //Config.FFmpegOptions.Add("probesize", 32);
            //Config.FFmpegOptions.Add("sync", "ext");

            this.InitializeComponent();
        }
Beispiel #7
0
        public MainPage()
        {
            Config = new FFmpegInteropConfig();

            this.InitializeComponent();

            // Show the control panel on startup so user can start opening media
            Splitter.IsPaneOpen = true;

            // optionally check for recommended ffmpeg version
            //FFmpegVersionInfo.CheckRecommendedVersion();

            // populate character encodings
            cbEncodings.ItemsSource = CharacterEncoding.GetCharacterEncodings();
        }
        public LiveDetailPage()
        {
            this.InitializeComponent();
            this.NavigationCacheMode = NavigationCacheMode.Disabled;
            dispRequest = new DisplayRequest();
            DataTransferManager dataTransferManager = DataTransferManager.GetForCurrentView();

            dataTransferManager.DataRequested += DataTransferManager_DataRequested;
            _config = new FFmpegInteropConfig();
            _config.FFmpegOptions.Add("rtsp_transport", "tcp");
            _config.FFmpegOptions.Add("user_agent", "Mozilla/5.0 BiliDroid/1.12.0 ([email protected])");
            _config.FFmpegOptions.Add("referer", "https://live.bilibili.com/");
            //每过2秒就设置焦点
            timer_focus = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(2)
            };

            timer_focus.Tick += Timer_focus_Tick;
            controlTimer      = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(1)
            };
            controlTimer.Tick += ControlTimer_Tick;
            settingVM          = new SettingVM();

            liveRoomVM  = new LiveRoomVM();
            mediaPlayer = new MediaPlayer();
            mediaPlayer.PlaybackSession.PlaybackStateChanged     += PlaybackSession_PlaybackStateChanged;
            mediaPlayer.PlaybackSession.BufferingStarted         += PlaybackSession_BufferingStarted;
            mediaPlayer.PlaybackSession.BufferingProgressChanged += PlaybackSession_BufferingProgressChanged;
            mediaPlayer.PlaybackSession.BufferingEnded           += PlaybackSession_BufferingEnded;
            mediaPlayer.MediaOpened   += MediaPlayer_MediaOpened;
            mediaPlayer.MediaEnded    += MediaPlayer_MediaEnded;;
            mediaPlayer.MediaFailed   += MediaPlayer_MediaFailed;
            liveRoomVM.ChangedPlayUrl += LiveRoomVM_ChangedPlayUrl;
            liveRoomVM.AddNewDanmu    += LiveRoomVM_AddNewDanmu;
            liveRoomVM.LotteryEnd     += LiveRoomVM_LotteryEnd;
            this.Loaded   += LiveDetailPage_Loaded;
            this.Unloaded += LiveDetailPage_Unloaded;
            //TODO 快捷键
        }
        public MainPage()
        {
            Config = new FFmpegInteropConfig();

            this.InitializeComponent();

            // Show the control panel on startup so user can start opening media
            Splitter.IsPaneOpen = true;
            AutoDetect.IsOn     = true;

            VideoEffectConfiguration = new VideoEffectConfiguration();

            // optionally check for recommended ffmpeg version
            //FFmpegVersionInfo.CheckRecommendedVersion();

            CodecChecker.CodecRequired += CodecChecker_CodecRequired;

            // populate character encodings
            cbEncodings.ItemsSource = CharacterEncoding.GetCharacterEncodings();

            this.KeyDown += MainPage_KeyDown;
        }
Beispiel #10
0
 public static void CreateConfig()
 {
     FFmpegConfig = new FFmpegInteropConfig
     {
     };
 }