0

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?

1 Answers1

0

I debugged it and I only get this error if i send file bytes as "inputContent". If i have file in google cloud and i send file url as "inputUri" then i do not get any error. (used gs://cloud-samples-data/video/cat.mp4" as sample for testing)

  • Thanks for answering. We have implemented this workaround and it seems to work. Unfortunately the old way with passing a ByteString in inputContent, which worked for a couple of months, doesn't seem to work anymore. Are there probably some recent breaking changes in the Video Intelligence API we could have missed? – Erik_Evers Apr 15 '20 at 06:51
  • I am not aware of any breaking change. The workaround does not work for me because we do not store file anywhere, on need bases we download it in memory and pass it through multiple ML services so passing it as inputContent was the best way for me. i am hoping that google will fix this limitation. – Adeel Meer Apr 16 '20 at 07:07