Jump to content

Recommended Posts

Hello Everyone,

 

I am stuck in a task to change byteArray to Video in php. I am creating a webservice in php. This service will receive video in byteArray format from iphone and need to convert it back to original video. I mean, webservice will receive byte array from POST. I could not find any way of converting byteArray into video. byteArray datatype does not seem to be supported by php.

 

Any help would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/268810-convert-bytearray-into-video-in-php/
Share on other sites

Hi Christian F.

 

I had a discussion with my friend about it, who is working in .NET technology:

 

Piyush: how do you convert byte array to video?

Piyush: what are the steps involved?

Shashank Awasthy: use the binary stream to read the byte array and then convert to video in C#

Shashank Awasthy: made a file from stream

Piyush: while writing to file, do you make any changes in encoding or write it as it is?

Shashank Awasthy: i just provide the byte array to stream reader and then convert the stream to file

Piyush: Ok

 

Is this helpful in any way? I do not have any experience with it in php and also I have no knowledge of C#.

It sounds like you'd just get the raw binary data so all you'd do is read in that data from wherever you need to and then write it out to a file (using file_put_contents for example). If it's a web service I'm guessing you'd get the data either as a $_POST variable, $_FILES upload, or $HTTP_RAW_POST_DATA.

Hi Kicken,

 

Thanks for your response. I already have tested with file_put_contents, but it does not seem to be working. I tried to convert a byte array file into video, but did not work. That is the file made by Iphone team from a video. I tried to convert it for testing purpose. So, if that file is not convertable, then data in post will not be converted, I think.

 

Is there any difference b/w data in post or data in a file? I could not send you the file because it's size is 1 mb. I can email you if I can get your email id.

 

Awaiting your response.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.