Merge pull request #62 from 3400442579/master

Snapshot ,Join   

Former-commit-id: 7faeda3094
This commit is contained in:
Malte Rosenbjerg 2020-05-17 01:36:37 +02:00 committed by GitHub
commit d948867396
2 changed files with 13 additions and 14 deletions

View file

@ -18,7 +18,7 @@ public static string Extension(this Codec type)
}
public static readonly string Mp4 = ".mp4";
public static readonly string Mp3 = ".mp3";
public static readonly string Ts = ".ts";
public static readonly string Ts = ".mpegts";
public static readonly string Ogv = ".ogv";
public static readonly string Png = ".png";
public static readonly string WebM = ".webm";

View file

@ -1,13 +1,12 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using FFMpegCore.Enums;
using FFMpegCore.Enums;
using FFMpegCore.Exceptions;
using FFMpegCore.Helpers;
using FFMpegCore.Pipes;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
namespace FFMpegCore
{
@ -76,7 +75,7 @@ public static Bitmap Snapshot(MediaAnalysis source, Size? size = null, TimeSpan?
{
if (size.Value.Width == 0)
{
var ratio = source.PrimaryVideoStream.Width / (double) size.Value.Width;
var ratio = (double)size.Value.Height / source.PrimaryVideoStream.Height;
size = new Size((int)(source.PrimaryVideoStream.Width * ratio),
(int)(source.PrimaryVideoStream.Height * ratio));
@ -84,7 +83,7 @@ public static Bitmap Snapshot(MediaAnalysis source, Size? size = null, TimeSpan?
if (size.Value.Height == 0)
{
var ratio = source.PrimaryVideoStream.Height / (double) size.Value.Height;
var ratio = (double)size.Value.Width / source.PrimaryVideoStream.Width;
size = new Size((int)(source.PrimaryVideoStream.Width * ratio),
(int)(source.PrimaryVideoStream.Height * ratio));