How to lazy transform an hevc/mkv video
Hello
I need to transform hevc/mkv videos to something that can be played in all browsers (mp4) It works fine for smaller videos, but the videos can become quite large (up to 500MB) and I need to transfer them eagerly lazy. Here is what I'm trying todo (latest Java client):
Map result = cloudinary.uploader()
.uploadLarge(IOUtils.toByteArray(storageProvider.get(media)),
ObjectUtils.asMap(
"resource_type", "auto",
"eager", Collections.singletonList(new Transformation().videoCodec("mp4")),
"eager_async", true,
"eager_notification_url", "http://mysite/rest/upload",
"notification_url", "http://mysite/rest/upload"));
I get back something like this:
{
"eager":[
{
"batch_id":"bb72700dd25c6c8ac581feac0eb7d16cf25c5f6a4c919d172739423f88a54673",
"secure_url":"https://res.cloudinary.com/qnnect/video/upload/vc_mp4/v1534153796/eudjik5qmj3pqmykngsd.mkv",
"url":"http://res.cloudinary.com/qnnect/video/upload/vc_mp4/v1534153796/eudjik5qmj3pqmykngsd.mkv",
"status":"processing"
}
],
"signature":"bc17ba1243d0ee4c83722aa2f791dc855a794683",
"created_at":"2018-08-13T09:49:56Z",
"video":{
"codec":"hevc",
"dar":"16:9",
"level":186,
"pix_format":"yuv420p",
"profile":"Main"
},
"type":"upload",
"public_id":"eudjik5qmj3pqmykngsd",
"duration":734.058,
"bit_rate":1152839,
"pages":0,
"original_filename":"file",
"placeholder":false,
"audio":{
"codec":"aac",
"channels":6,
"channel_layout":"5.1",
"frequency":48000
},
"height":720,
"rotation":0,
"format":"mkv",
"resource_type":"video",
"secure_url":"https://res.cloudinary.com/qnnect/video/upload/v1534153796/eudjik5qmj3pqmykngsd.mkv",
"version":1534153796,
"frame_rate":24.0,
"done":true,
"url":"http://res.cloudinary.com/qnnect/video/upload/v1534153796/eudjik5qmj3pqmykngsd.mkv",
"tags":[
],
"is_audio":false,
"bytes":105781364,
"width":1280,
"etag":"faddc904f52765f1e47084f729f6a703"
}
When I open https://res.cloudinary.com/qnnect/video/upload/vc_mp4/v1534153796/eudjik5qmj3pqmykngsd.mkv
I get in the response header:
-
Hi Yakir
Sorry, same result, i.e. https://res.cloudinary.com/qnnect/video/upload/vc_mp4/v1534161843/qmcjucbsrlbieudl149r.mkv
Regards
Benno
-
ok, thanks for the update.
I checked the issue, and that should work:
Map result = cloudinary.uploader()
.uploadLarge(IOUtils.toByteArray(storageProvider.get(media)),
ObjectUtils.asMap(
"resource_type", "video",
"eager", Collections.singletonList(new Transformation().videoCodec("h264").format("mp4"),
"eager_async", true,
"eager_notification_url", "http://mysite/rest/upload",
"notification_url", "http://mysite/rest/upload"));Please let me know if it works for you.
Cheers
-
Hi Yakir
Thanks for your help. There is no format method on Transformation, so I try fetchFormat. But the result remains the same:
i.e. http://res.cloudinary.com/qnnect/video/upload/f_mp4,vc_h264/v1534424367/hhvnhvzd4y0kxrxbg8v3.mp4
X-Cld-Error:Video is too large to process synchronously, please use an eager transformation with eager_async=true to resolveAny Idea?Best RegardsBenno -
Yes - you're right, it's fetchformat.
Anyway, I checked the logs, and while we tried to eagerly transform your video - we sent you this callback:{"notification_type":"eager","eager":[{"transformation":"f_mp4,vc_h264","status":"failed","reason":"Cannot generate H.264 videos longer than 720 - please contact support."}]
This error is returned because videos longer than 12 minutes may require special licensing terms (unrelated to MPEG-DASH or HLS transformation).
I've now enabled your account to be able to transform long videos, however, please take into account is mp4-h264 license terms, that come into play when videos are longer than 12 minutes. For more information:
http://www.mpegla.com/main/programs/avc/Documents/avcweb.pdfPlease try again and let me know if it works for you.
Cheers
--Yakir
Post is closed for comments.
Comments
6 comments