When I try to transcribe some video's I do get the following error message:
java.util.concurrent.ExecutionException: com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Request contains an invalid argument. at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:553) ~[guava-28.2-android.jar!/:na] at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:432) ~[guava-28.2-android.jar!/:na] at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:93) ~[guava-28.2-android.jar!/:na] at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:68) ~[guava-28.2-android.jar!/:na] at com.google.api.gax.longrunning.OperationFutureImpl.get(OperationFutureImpl.java:133) ~[gax-1.53.0.jar!/:1.53.0]
In the process MP4 video's are converted to WEBM so we are able to stream the video's correctly in our frontend. There seems to be a problem with the ByteArray of the WEBM file we pass to the request, so I tried to pass the ByteArray of the MP4 file directly. Unfortunately I did get the same error here with multiple MP4 files. There are also some MP4 files which are transcribed succesfully. So I don't know what is wrong with the ByteArray and how to fix this problem.
Our AnnotateVideoRequest is builded in this way:
private fun buildRequest(
videoBytes: ByteString,
transcriptionLanguage: String
): AnnotateVideoRequest {
val config: SpeechTranscriptionConfig = SpeechTranscriptionConfig
.newBuilder()
.setLanguageCode(transcriptionLanguage)
.setEnableAutomaticPunctuation(this.enableAutomaticPunctuation)
.setMaxAlternatives(this.maxAlternatives)
.build()
val context: VideoContext = VideoContext
.newBuilder()
.setSpeechTranscriptionConfig(config)
.build()
return AnnotateVideoRequest
.newBuilder()
.setInputContent(videoBytes)
.addFeatures(Feature.SPEECH_TRANSCRIPTION)
.setVideoContext(context)
.build()
}
We make use of the of the following version of the client library: com.google.cloud:google-cloud-video-intelligence:1.2.1
What are possible ways to determine what is actually going wrong when performing this request with some of our MP4 files?