parent
93ab829df5
commit
56f580cdf6
@ -0,0 +1,22 @@
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.MediaEncoding.Probing;
|
||||
using Xunit;
|
||||
|
||||
namespace Jellyfin.MediaEncoding.Tests
|
||||
{
|
||||
public class FFprobeParserTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("ffprobe1.json")]
|
||||
public async Task Test(string fileName)
|
||||
{
|
||||
var path = Path.Join("Test Data", fileName);
|
||||
using (var stream = File.OpenRead(path))
|
||||
{
|
||||
await JsonSerializer.DeserializeAsync<InternalMediaInfoResult>(stream).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
{
|
||||
"streams": [
|
||||
{
|
||||
"index": 0,
|
||||
"codec_name": "h264",
|
||||
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
|
||||
"profile": "Main",
|
||||
"codec_type": "video",
|
||||
"codec_time_base": "1/50",
|
||||
"codec_tag_string": "[27][0][0][0]",
|
||||
"codec_tag": "0x001b",
|
||||
"width": 1920,
|
||||
"height": 1080,
|
||||
"coded_width": 1920,
|
||||
"coded_height": 1080,
|
||||
"has_b_frames": 0,
|
||||
"sample_aspect_ratio": "0:1",
|
||||
"display_aspect_ratio": "0:1",
|
||||
"pix_fmt": "yuvj420p",
|
||||
"level": 42,
|
||||
"color_range": "pc",
|
||||
"color_space": "bt709",
|
||||
"color_transfer": "bt709",
|
||||
"color_primaries": "bt709",
|
||||
"chroma_location": "left",
|
||||
"field_order": "progressive",
|
||||
"refs": 1,
|
||||
"is_avc": "false",
|
||||
"nal_length_size": "0",
|
||||
"id": "0x1",
|
||||
"r_frame_rate": "25/1",
|
||||
"avg_frame_rate": "25/1",
|
||||
"time_base": "1/90000",
|
||||
"start_pts": 8570867078,
|
||||
"start_time": "95231.856422",
|
||||
"duration_ts": 31694552,
|
||||
"duration": "352.161689",
|
||||
"bits_per_raw_sample": "8",
|
||||
"disposition": {
|
||||
"default": 0,
|
||||
"dub": 0,
|
||||
"original": 0,
|
||||
"comment": 0,
|
||||
"lyrics": 0,
|
||||
"karaoke": 0,
|
||||
"forced": 0,
|
||||
"hearing_impaired": 0,
|
||||
"visual_impaired": 0,
|
||||
"clean_effects": 0,
|
||||
"attached_pic": 0,
|
||||
"timed_thumbnails": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"index": 1,
|
||||
"codec_name": "aac",
|
||||
"codec_long_name": "AAC (Advanced Audio Coding)",
|
||||
"profile": "LC",
|
||||
"codec_type": "audio",
|
||||
"codec_time_base": "1/44100",
|
||||
"codec_tag_string": "[15][0][0][0]",
|
||||
"codec_tag": "0x000f",
|
||||
"sample_fmt": "fltp",
|
||||
"sample_rate": "44100",
|
||||
"channels": 2,
|
||||
"channel_layout": "stereo",
|
||||
"bits_per_sample": 0,
|
||||
"id": "0x2",
|
||||
"r_frame_rate": "0/0",
|
||||
"avg_frame_rate": "0/0",
|
||||
"time_base": "1/90000",
|
||||
"start_pts": 8570867697,
|
||||
"start_time": "95231.863300",
|
||||
"duration_ts": 31695687,
|
||||
"duration": "352.174300",
|
||||
"bit_rate": "98191",
|
||||
"disposition": {
|
||||
"default": 0,
|
||||
"dub": 0,
|
||||
"original": 0,
|
||||
"comment": 0,
|
||||
"lyrics": 0,
|
||||
"karaoke": 0,
|
||||
"forced": 0,
|
||||
"hearing_impaired": 0,
|
||||
"visual_impaired": 0,
|
||||
"clean_effects": 0,
|
||||
"attached_pic": 0,
|
||||
"timed_thumbnails": 0
|
||||
}
|
||||
}
|
||||
],
|
||||
"format": {
|
||||
"filename": "TS Test record.ts",
|
||||
"nb_streams": 2,
|
||||
"nb_programs": 1,
|
||||
"format_name": "mpegts",
|
||||
"format_long_name": "MPEG-TS (MPEG-2 Transport Stream)",
|
||||
"start_time": "95231.856422",
|
||||
"duration": "352.181178",
|
||||
"size": "179003772",
|
||||
"bit_rate": "4066174",
|
||||
"probe_score": 50
|
||||
}
|
||||
}
|
Loading…
Reference in new issue