1

I am uploading all format(.webm,.wmv,.avi ..etc) video file from web using swift API PHP. After uploading video file on openstack object storage then I need to convert all video file in one format .mp4.

Is it possible to convert video in one format(.mp4). Please suggest.

Pankaj Yadav
  • 222
  • 4
  • 12

1 Answers1

0

As you might have suspected, there is no built-in functionality in Swift to perform video transcoding. However, there is a mechanism for adding additional processing logic, which is where you could implement a transcoder. This mechanism is called "middleware" and is essentially just a very simple Python API that you implement. Then put your implementation in a special directory where the proxy will load it when it starts.

So you can write a middleware which will trigger when a file is uploaded, check the extension, perform the transcoding, and then issue another request to save that file in addition to (or in place of) the original file.

There's just one small catch... That would bring your cluster to its knees because middleware calls block the proxy workers. If you care about performance at all, this would need to be done asynchronously. To do that, there's only one solution I know of:

Implement the transcoding logic in Java and take advantage of the Storlets middleware. Storlets will run your custom logic on a pool of compute resources in Docker containers without blocking the proxy (too much).

I know it sounds complicated. But you're on the forefront of a brave new frontier in storage technology.

Adam Takvam
  • 116
  • 5