We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to get get the data of video from the photo library. I am using following code:-
{ videoArray = [self getContentFrom:group withAssetFilter:[ALAssetsFilter allVideos]]; if (videoArray.count) { ALAssetRepresentation *rep = [videoArray lastObject]; Byte *buffer = (Byte *)malloc(rep.size); NSUInteger buffered = [rep getBytes:buffer fromOffset:0.0 length:rep.size error:nil]; NSData *data = [NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];
RtmpWrapper *rtmp = [[RtmpWrapper alloc] init]; BOOL ret = [rtmp openWithURL:@"rtmp://173.224.117.133:1935/oflaDemo/1" enableWrite:YES]; if (ret) { NSData *video = data; NSLog(@"original video length: %d", [video length]); NSUInteger length = [video length]; NSUInteger chunkSize = 20 * 5120; NSUInteger offset = 0; // Let's split video to small chunks to publish to media server do { NSUInteger thisChunkSize = length - offset > chunkSize ? chunkSize : length - offset; NSData *chunk = [NSData dataWithBytesNoCopy:(char *)[video bytes] + offset length:thisChunkSize freeWhenDone:NO]; offset += thisChunkSize; // Write new chunk to rtmp server [rtmp write:chunk withCompletion: ^(NSUInteger sent, NSError *error) { NSLog(@"sent -> %d", sent); if (error) { NSLog(@"error -> %@", [error description]); } }]; sleep(1); } while (offset < length); } // Close rtmp connection and release class object [rtmp close]; } }
It is not displaying video on website. Any reason what I am doing wrong?
The text was updated successfully, but these errors were encountered:
This RTMP wrapper only transfer FLV data not mp4, Probably the video in your photo gallery in MP4 format.
In this case, you might have a look https://github.com/ifactorylab/IFVideoPicker, I will do huge update for IFVideoPicker / RTMPWrapper soon.
Hopefully it helps you out.
Thanks Min
Sorry, something went wrong.
No branches or pull requests
I am trying to get get the data of video from the photo library. I am using following code:-
{
videoArray = [self getContentFrom:group withAssetFilter:[ALAssetsFilter allVideos]];
if (videoArray.count) {
ALAssetRepresentation *rep = [videoArray lastObject];
Byte *buffer = (Byte *)malloc(rep.size);
NSUInteger buffered = [rep getBytes:buffer fromOffset:0.0 length:rep.size error:nil];
NSData *data = [NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];
It is not displaying video on website. Any reason what I am doing wrong?
The text was updated successfully, but these errors were encountered: