Status Update
Comments
ds...@google.com <ds...@google.com>
ds...@google.com <ds...@google.com> #3
Hello, is the issue you are experiencing now fixed?
le...@gmail.com <le...@gmail.com> #4
No, transcoding these two videos still fails.
le...@gmail.com <le...@gmail.com> #5
The following is code
using Google.Api.Gax.ResourceNames;
using Google.Cloud.Video.Transcoder.V1;
public class GoogleCloudVideoTranscoder
{
public static string projectId = "lk-research";
// 注意存储桶和 location 用同地区的,会更快
public static string location = "asia-east1";
public static string bucket = "video-transcode-az108";
public static string inputObj = "91a637d4-a5f2-41d8-bdcc-ba1af5de6a26";
public static string inputUri = createInputStorageUri(inputObj);
public static string outputUri = Utils.createOutputStorageUri(inputUri);
public static string credentialPath = "D:\\azureBlob.json";
public const string thumb = "thumb";
public static void startTranscodeJob()
{
var startTime = DateTime.Now;
var job = CreateTranscodeJob(projectId, location, inputUri, outputUri);
var startTime1 = DateTime.Now;
Console.WriteLine($"==========={new DateTime()} {job.State}========");
Console.WriteLine($"job : {job.JobName.JobId}");
Console.WriteLine($"inputUri : {inputUri}");
Console.WriteLine($"outputUri : {outputUri}");
while (true)
{
var currentJob = GetJob(job.JobName);
Console.WriteLine($"{DateTime.Now} {currentJob.State}");
if (currentJob.State == Job.Types.ProcessingState.Succeeded
|| currentJob.State == Job.Types.ProcessingState.Failed)
{
Console.WriteLine($"==========={currentJob.State} ");
Console.WriteLine(currentJob.Error);
Console.WriteLine($"createTime ~ endTime : {DateTime.Now - startTime }");
Console.WriteLine($"stratTime ~ endTime : {DateTime.Now - startTime1 }");
Console.WriteLine($"createTime ~ endTime : {currentJob.EndTime.ToDateTime() - currentJob.CreateTime.ToDateTime()}");
Console.WriteLine($"startTime ~ endTime : {currentJob.EndTime.ToDateTime() - currentJob.StartTime.ToDateTime()}");
return;
}
Thread.Sleep(1000);
}
}
public static Job GetJob(JobName jobName)
{
// Create the client.
TranscoderServiceClient client = TranscoderServiceClient.Create();
// Call the API.
Job job = client.GetJob(jobName);
// Return the result.
return job;
}
public static JobConfig CreateJobConfig()
{
VideoStream videoStream0 = new VideoStream
{
H264 = new VideoStream.Types.H264CodecSettings
{
BitrateBps = 2500000,
FrameRate = 60,
}
};
AudioStream audioStream0 = new AudioStream
{
Codec = "aac",
BitrateBps = 64000
};
SpriteSheet thumbImg = new SpriteSheet
{
FilePrefix = thumb,
ColumnCount = 1,
RowCount = 1,
TotalCount = 1
};
ElementaryStream elementaryStream0 = new ElementaryStream
{
Key = "video_stream0",
VideoStream = videoStream0,
};
ElementaryStream elementaryStream1 = new ElementaryStream
{
Key = "audio_stream0",
AudioStream = audioStream0
};
MuxStream muxStream0 = new MuxStream
{
Key = "hd",
Container = "mp4",
ElementaryStreams = { "video_stream0", "audio_stream0" },
};
var topic = "test";
return new JobConfig
{
ElementaryStreams = { elementaryStream0, elementaryStream1 },
MuxStreams = { muxStream0 },
SpriteSheets = { thumbImg },
PubsubDestination = new PubsubDestination
{
Topic = $"projects/{projectId}/topics/{topic}"
}
};
}
public static Job CreateTranscodeJob(
string projectId, string location, string inputUri, string outputUri)
{
// Create the client.
TranscoderServiceClient client = TranscoderServiceClient.Create();
// Build the parent location name.
LocationName parent = new LocationName(projectId, location);
// Build the job config.
var jobConfig = CreateJobConfig();
var jobTemplate = client.CreateJobTemplate(parent, new JobTemplate
{
Config = jobConfig,
}, "test" + Utils.GetTimeStrForPath());
// Build the job.
Job newJob = new Job
{
InputUri = inputUri,
OutputUri = outputUri,
TemplateId = jobTemplate.JobTemplateName.JobTemplateId,
Labels = { { "institutionid","1234"}}
};
// Call the API.
Job job = client.CreateJob(parent, newJob);
// Return the result.
return job;
}
public static string createInputStorageUri(string fileName)
{
return $"gs://{bucket}/{fileName}";
}
}
class Utils
{
public static string GetTimeStr(DateTime date)
{
return date.ToString("yyyy-MM-dd HH:mm:ss");
}
public static string GetTimeStr()
{
return GetTimeStr(DateTime.Now);
}
public static string GetTimeStrForPath()
{
return GetTimeStr().Replace(":", "-").Replace(" ", "_");
}
public static string createOutputStorageUri(string inputUri)
{
int lastIndex = inputUri.LastIndexOf('.');
var time = Utils.GetTimeStrForPath();
var folder = lastIndex >= 0 ? inputUri.Substring(0, lastIndex) : inputUri;
return $"{folder}/{time}/";
}
}
ds...@google.com <ds...@google.com> #6
Hello,
Thank you for reaching out to us with your request.
We have duly noted your feedback and will thoroughly validate it. While we cannot provide an estimated time of implementation or guarantee the fulfillment of the issue, please be assured that your input is highly valued. Your feedback enables us to enhance our products and services.
To ensure a faster resolution and dedicated support for your issue, I kindly request you to file a support ticket by clicking
Once again, we sincerely appreciate your valuable feedback; Thank you for your understanding and collaboration.
le...@gmail.com <le...@gmail.com> #7
Thank you. Please let me know if there is any progress.
li...@onlala.vn <li...@onlala.vn> #8
I meet too much issues
Description
code for job config
error
Error code is 3 , and error msg is "Failed to generate output for elementary stream video_stream0. Media frames are missing starting at time 0s and ending at time 120s."
video