<commit_before>﻿namespace Unosquare.FFplayDotNet.Console
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.IO;
    using System.Runtime.InteropServices;
    using System.Threading;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Threading;
    using Unosquare.FFplayDotNet.Core;
    using Unosquare.Swan;

    static class TestInputs
    {
        private static string InputBasePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "videos");

        #region Local Files

        /// <summary>
        /// The matroska test. It contains various subtitle an audio tracks
        /// Files can be obtained here: https://sourceforge.net/projects/matroska/files/test_files/matroska_test_w1_1.zip/download
        /// </summary>
        public static string MatroskaLocalFile = $"{InputBasePath}\\matroska.mkv";

        /// <summary>
        /// The transport stream file
        /// From: https://github.com/unosquare/ffmediaelement/issues/16#issuecomment-299183167
        /// </summary>
        public static string TransportLocalFile = $"{InputBasePath}\\transport.ts";

        /// <summary>
        /// Downloaded From: https://www.dropbox.com/sh/vggf640iniwxwyu/AABSeLJfAZeApEoJAY3N34Y2a?dl=0
        /// </summary>
        public static string BigBuckBunnyLocal = $"{InputBasePath}\\bigbuckbunny.mp4";

        public static string YoutubeLocalFile = $"{InputBasePath}\\youtube.mp4";

        /// <summary>
        /// The mpg file form issue https://github.com/unosquare/ffmediaelement/issues/22
        /// </summary>
        public static string MpegPart2LocalFile = $"{InputBasePath}\\mpegpart2.mpg";

        public static string PngTestLocalFile = $"{InputBasePath}\\pngtest.png";

        #endregion

        #region Network Files

        public static string UdpStream = @"udp://@192.168.3.111:5181/";

        public static string UdpStream2 = @"udp://@172.16.17.32:5003/";

        public static string HlsStream = @"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8";

        /// <summary>
        /// The RTSP stream from http://g33ktricks.blogspot.mx/p/the-rtsp-real-time-streaming-protocol.html
        /// </summary>
        public static string RtspStream = "rtsp://172.16.17.32/vod/mp4:BigBuckBunny_175k.mov";

        public static string NetworkShareStream = @"\\STARBIRD\Dropbox\MEXICO 20120415 TOLUCA 0-3 CRUZ AZUL.mp4";

        public static string NetworkShareStream2 = @"\\STARBIRD\Public\Movies\Ender's Game (2013).mp4";

        #endregion
    }

    class Program
    {
        private static string OutputPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "output");


        static void Main(string[] args)
        {

            // BigBuckBunnyLocal, 20 seconds, 1.036 secs.
            // TODO: 
            // May 5: 1.255 secs to decode 20 seconds 
            // May 8: 1.466 secs to decode 20 seconds
            // May 9: 0.688 secs to decode 20 seconds
            var inputFile = TestInputs.NetworkShareStream2;
            var decodeDurationLimit = 60 * 5d;
            var isBenchmarking = false;
            var saveWaveFile = false;
            var saveSnapshots = true;
            Dispatcher decompressDispatcher = null;

            #region Setup<commit_msg>adding hls examples<commit_after>﻿namespace Unosquare.FFplayDotNet.Console
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.IO;
    using System.Runtime.InteropServices;
    using System.Threading;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Threading;
    using Unosquare.FFplayDotNet.Core;
    using Unosquare.Swan;

    static class TestInputs
    {
        private static string InputBasePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "videos");

        #region Local Files

        /// <summary>
        /// The matroska test. It contains various subtitle an audio tracks
        /// Files can be obtained here: https://sourceforge.net/projects/matroska/files/test_files/matroska_test_w1_1.zip/download
        /// </summary>
        public static string MatroskaLocalFile = $"{InputBasePath}\\matroska.mkv";

        /// <summary>
        /// The transport stream file
        /// From: https://github.com/unosquare/ffmediaelement/issues/16#issuecomment-299183167
        /// </summary>
        public static string TransportLocalFile = $"{InputBasePath}\\transport.ts";

        /// <summary>
        /// Downloaded From: https://www.dropbox.com/sh/vggf640iniwxwyu/AABSeLJfAZeApEoJAY3N34Y2a?dl=0
        /// </summary>
        public static string BigBuckBunnyLocal = $"{InputBasePath}\\bigbuckbunny.mp4";

        public static string YoutubeLocalFile = $"{InputBasePath}\\youtube.mp4";

        /// <summary>
        /// The mpg file form issue https://github.com/unosquare/ffmediaelement/issues/22
        /// </summary>
        public static string MpegPart2LocalFile = $"{InputBasePath}\\mpegpart2.mpg";

        public static string PngTestLocalFile = $"{InputBasePath}\\pngtest.png";

        #endregion

        #region Network Files

        public static string UdpStream = @"udp://@172.16.31.10:5181/";

        public static string UdpStream2 = @"udp://@172.16.17.32:5003/";

        public static string HlsStream = @"http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8";

        public static string HlsStream2 = @"https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8";

        public static string HlsStream3 = @"https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8";

        /// <summary>
        /// The RTSP stream from http://g33ktricks.blogspot.mx/p/the-rtsp-real-time-streaming-protocol.html
        /// </summary>
        public static string RtspStream = "rtsp://172.16.17.32/vod/mp4:BigBuckBunny_175k.mov";

        public static string NetworkShareStream = @"\\STARBIRD\Dropbox\MEXICO 20120415 TOLUCA 0-3 CRUZ AZUL.mp4";

        public static string NetworkShareStream2 = @"\\STARBIRD\Public\Movies\Ender's Game (2013).mp4";

        #endregion
    }

    class Program
    {
        private static string OutputPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "output");


        static void Main(string[] args)
        {

            // BigBuckBunnyLocal, 20 seconds, 1.036 secs.
            // TODO: 
            // May 5: 1.255 secs to decode 20 seconds 
            // May 8: 1.466 secs to decode 20 seconds
            // May 9: 0.688 secs to decode 20 seconds
            var inputFile = TestInputs.HlsStream3;
            var decodeDurationLimit = 20;
            var isBenchmarking = false;
            var saveWaveFile = true;
            var saveSnapshots = true;
            Dispatcher decompressDispatcher = null;

            #region Setup
{'fraction_non_alphanumeric': 0.1122987229317046, 'fraction_numerical': 0.036368684064408664, 'mean_word_length': 2.475639170284612, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3212380', 'n_tokens_mistral': 2373, 'n_tokens_neox': 2128, 'n_words': 452}