Skip to content

Commit

Permalink
Fix up Youtube Proxy
Browse files Browse the repository at this point in the history
Fix QTConvert Profile Path and upgraded LibVideo to a newer build
  • Loading branch information
pgodwin committed Jul 23, 2017
1 parent 8540a8a commit 65b43a2
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 52,405 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,4 @@ __pycache__/
*.odx.cs
*.xsd.cs
/YouTubeProxy/ExternalBin/ffmpeg.exe
YouTubeProxy/obj/Debug/YouTubeProxy.csproj.FileListAbsolute.txt
6 changes: 3 additions & 3 deletions YouTubeProxy/App.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="baseAddress" value="http://*"/>
<add key="port" value="9000"/>
<add key="baseAddress" value="http://127.0.0.1" />
<add key="port" value="9000" />
</appSettings>


Expand All @@ -14,7 +14,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
2 changes: 1 addition & 1 deletion YouTubeProxy/Controllers/VideoController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public MacDeliminatedResult<ConversionStatusModel> Get(string id, string profile
new Thread(() =>
{
Thread.CurrentThread.IsBackground = true;
VideoEncoder.StartEncoding(profile, id, video.Uri);
VideoEncoder.StartEncoding(profile, id, video.GetUri());
}).Start();

return new MacDeliminatedResult<ConversionStatusModel>(status);
Expand Down
9 changes: 6 additions & 3 deletions YouTubeProxy/Helpers/VideoEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ public class VideoEncoder
{

/// <summary>
/// Hacky as shit, move this to an external file.
/// DEFINE YOUR ENCODING PROFILES HERE!
/// </summary>
public static Dictionary<string, EncodingProfile> profiles = new Dictionary<string, EncodingProfile>()
{
{ "video1", new EncodingProfile()
{
Name = "video1",
Exe = "QTConverter.exe",
Arguments = "video1.xml {0} {1}.mov"
Arguments = @"profiles\video1.xml {0} {1}.mov"
}
},
{
"cinepak", new EncodingProfile()
{
Name = "cinepak",
Exe = "QTConverter.exe",
Arguments = "cinepak.xml {0} {1}.mov"
Arguments = @"profiles\cinepak.xml {0} {1}.mov"
}
},
{ "h263", new EncodingProfile()
Expand Down Expand Up @@ -89,6 +89,9 @@ public static void StartEncoding(string encoder, string videoId, string uri)
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = profile.Exe;
string arguments = string.Format(profile.Arguments, uri, @".\video\" + videoId);

Console.WriteLine("Running: {0} {1}", startInfo.FileName, arguments);

startInfo.Arguments = arguments;
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardOutput = true;
Expand Down
14 changes: 10 additions & 4 deletions YouTubeProxy/YouTubeProxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'ClientTest|AnyCPU'">
<OutputPath>bin\ClientTest\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.7.4137.9688, Culture=neutral, PublicKeyToken=a4292a325f69b123, processorArchitecture=MSIL">
<HintPath>..\packages\BouncyCastle.1.7.0\lib\Net40-Client\BouncyCastle.Crypto.dll</HintPath>
Expand Down Expand Up @@ -60,8 +63,8 @@
<HintPath>..\packages\Google.Apis.YouTube.v3.1.13.1.529\lib\portable-net45+netcore45+wpa81+wp8\Google.Apis.YouTube.v3.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="libvideo, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\VideoLibrary.1.3.4\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\libvideo.dll</HintPath>
<Reference Include="libvideo, Version=1.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nefarius-VideoLibrary.1.4.0\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\libvideo.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
Expand All @@ -80,8 +83,8 @@
<HintPath>..\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
Expand Down Expand Up @@ -158,6 +161,9 @@
<Content Include="Profiles\video1.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="video\VideosGoHere.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BMFF\BMFF\MatrixIO.IO.Bmff\MatrixIO.IO.Bmff.csproj">
Expand Down
12 changes: 12 additions & 0 deletions YouTubeProxy/obj/Debug/YouTubeProxy.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,15 @@ C:\Users\pete\Documents\GitHub\68kTube\bin\YouTubeProxy.pdb
C:\Users\pete\Documents\GitHub\68kTube\YouTubeProxy\obj\Debug\YouTubeProxy.csprojResolveAssemblyReference.cache
C:\Users\pete\Documents\GitHub\68kTube\YouTubeProxy\obj\Debug\YouTubeProxy.exe
C:\Users\pete\Documents\GitHub\68kTube\YouTubeProxy\obj\Debug\YouTubeProxy.pdb
C:\Users\pete\Repo\68kTube\bin\ExternalBin\ffmpeg.exe
C:\Users\pete\Repo\68kTube\YouTubeProxy\obj\Debug\YouTubeProxy.csprojResolveAssemblyReference.cache
C:\Users\pete\Repo\68kTube\YouTubeProxy\obj\Debug\YouTubeProxy.exe
C:\Users\pete\Repo\68kTube\YouTubeProxy\obj\Debug\YouTubeProxy.pdb
C:\Users\pete\Repo\68kTube\bin\apikey.txt
C:\Users\pete\Repo\68kTube\bin\Profiles\cinepak.xml
C:\Users\pete\Repo\68kTube\bin\Profiles\quadra.xml
C:\Users\pete\Repo\68kTube\bin\Profiles\video1.xml
C:\Users\pete\Repo\68kTube\bin\YouTubeProxy.exe.config
C:\Users\pete\Repo\68kTube\bin\YouTubeProxy.exe
C:\Users\pete\Repo\68kTube\bin\YouTubeProxy.pdb
C:\Users\pete\Repo\68kTube\bin\video\VideosGoHere.txt
4 changes: 2 additions & 2 deletions YouTubeProxy/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<package id="Microsoft.Owin" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Owin.Host.HttpListener" version="2.0.2" targetFramework="net45" />
<package id="Microsoft.Owin.Hosting" version="2.0.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="Nefarius-VideoLibrary" version="1.4.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="VideoLibrary" version="1.3.4" targetFramework="net45" />
<package id="Zlib.Portable.Signed" version="1.11.0" targetFramework="net45" />
</packages>
1 change: 1 addition & 0 deletions YouTubeProxy/video/VideosGoHere.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file not shown.
Loading

0 comments on commit 65b43a2

Please sign in to comment.