piyusharora420 Posted September 26, 2012 Share Posted September 26, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/268810-convert-bytearray-into-video-in-php/ Share on other sites More sharing options...
Christian F. Posted September 26, 2012 Share Posted September 26, 2012 You have any examples of this byteArray format, as well as the source video that produced it? Quote Link to comment https://forums.phpfreaks.com/topic/268810-convert-bytearray-into-video-in-php/#findComment-1381004 Share on other sites More sharing options...
piyusharora420 Posted September 26, 2012 Author Share Posted September 26, 2012 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#. Quote Link to comment https://forums.phpfreaks.com/topic/268810-convert-bytearray-into-video-in-php/#findComment-1381047 Share on other sites More sharing options...
kicken Posted September 26, 2012 Share Posted September 26, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/268810-convert-bytearray-into-video-in-php/#findComment-1381054 Share on other sites More sharing options...
piyusharora420 Posted September 27, 2012 Author Share Posted September 27, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/268810-convert-bytearray-into-video-in-php/#findComment-1381261 Share on other sites More sharing options...
piyusharora420 Posted September 27, 2012 Author Share Posted September 27, 2012 Hi Christian, I can email you the byte array file of a video, if you would like. File size is more than permissible limit. Please let me know your email address. Quote Link to comment https://forums.phpfreaks.com/topic/268810-convert-bytearray-into-video-in-php/#findComment-1381262 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.