Giter Site home page Giter Site logo

Comments (23)

slavavdovichenko avatar slavavdovichenko commented on August 16, 2024

Yes - see RTMPStreamPlayer demo sample here

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Thank you for the response.

My exact requirement is as follows:

I have video from a drone camera(which is the external source) playing on my iPad, I want to stream this video stream live from iPad to a media server such as Wowza.

Can I acheive this using MediaLibDemos3x?

from medialibdemos3x.

slavavdovichenko avatar slavavdovichenko commented on August 16, 2024

Yes - see RTMPStreamPublisher demo sample ))
In ViewController.m set the url of your wowza - and try:

-(void)viewDidLoad {

//[DebLog setIsActive:YES];

[super viewDidLoad];

socket = nil;
upstream = nil;

hostTextField.text = @"rtmp://10.0.1.62:1935/live";
hostTextField.delegate = self;

streamTextField.text = @"teststream";
streamTextField.delegate = self;

}

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Yes I have successfully tried streaming the iPad camera video to Wowza using MediaLibDemos3x, however I would like to stream the drone video and not the iPad camera video from iPad to Wowza.

from medialibdemos3x.

slavavdovichenko avatar slavavdovichenko commented on August 16, 2024

For your purpose you have to use VIDEO_CUSTOM publisher mode.
Give me your email - I'll send the demo project.

On Tue, Jun 16, 2015 at 6:48 PM, sdave28jul [email protected]
wrote:

Yes I have tried streaming the iPad camera video to Wowza, however I would
like to stream the drone video and not the iPad camera video from iPad to
Wowza.


Reply to this email directly or view it on GitHub
#27 (comment)
.

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Please email at [email protected]

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Thank you for the demo project, can you please provide some more pointers on how I could stream the drone video playing on the ipad using this sample?

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Hi,

I'm not able to stream to server with mode set to VIDEO_CUSTOM. I tried streaming to wowza with the attached sample but all I see is a black screen on wowza. It would be of great help if you could provide some more pointers.

from medialibdemos3x.

slavavdovichenko avatar slavavdovichenko commented on August 16, 2024

Hi,
I am implementing a new sample just now - I let know when it will be ready

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Thank you for the response. I already have the H264 video from drone camera playing on my iOS device, hence my requiremnt would be just to stream this video using rtmp and not do any video encoding (as I'm not using the ipad/iphone camera input)

Please let me know if it is in scope of MediaLibDemos3x to stream any video playing on iOS device (not the iOS camera video) to media server.

from medialibdemos3x.

slavavdovichenko avatar slavavdovichenko commented on August 16, 2024

Can you give me the data format that you get from your drone? Can you
represent them in some CoreMedia struct,

CMSampleBuffer or CVImageBuffer, for example?

On Thu, Jun 25, 2015 at 5:58 PM, sdave28jul [email protected]
wrote:

Thank you for the response. I already have the H264 video from drone
camera playing on my iOS device, hence my requiremnt would be just to
stream this video using rtmp and not do any video encoding (as I'm not
using the ipad/iphone camera input)

Please let me know if it is in scope of MediaLibDemos3x to stream any
video playing on iOS device (not the iOS camera video) to media server.


Reply to this email directly or view it on GitHub
#27 (comment)
.

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Im receiving the video from a Parrot Bebop drone using the follwing iOS sample

https://github.com/BrennanJones/BebopDroneVideoStreaming-iOS

from medialibdemos3x.

slavavdovichenko avatar slavavdovichenko commented on August 16, 2024

Ok,

You can make the following:

  1. Add somewhere (maybe as RTMP singleton) the same methods as I've made in SquareCamViewController class of SquareCam sample:
    //-------------------------------------- IMediaStreamEvent mehods ------------------------------------------------

@interface SquareCamViewController (IMediaStreamEvent)
-(void)connectPublish;
-(void)disconnectPublish;
-(void)startPublish;
-(void)stopPublish;
-(void)sendFrame:(CMSampleBufferRef)sampleBuffer;
@EnD

@implementation SquareCamViewController (IMediaStreamEvent)

-(void)connectPublish {

NSLog(@"ConnectPublish\n");    
if (upstream)
    return;    

MPMediaPublishType publishType = (NO) ? PUBLISH_LIVE : PUBLISH_RECORD;
upstream = [[BroadcastStreamClient alloc] init:@"rtmp://192.168.1.100:1935/live"];    
upstream.delegate = self;
[upstream setVideoMode:VIDEO_CUSTOM];
[upstream setAudioMode:AUDIO_OFF];
[upstream stream:@"iPhoneMedia" publishType:publishType];    

}

-(void)disconnectPublish {

NSLog(@"disconnectPublish\n");

if (!upstream) 
    return;

[upstream disconnect];
[upstream release];
upstream = nil;

}

-(void)startPublish {

NSLog(@"startPublish\n");

if (!upstream) 
    return;

[upstream start];

}

-(void)stopPublish {

NSLog(@"stopPublish\n");

if (!upstream) 
    return;    

[upstream pause];

}

-(void)sendFrame:(CMSampleBufferRef)sampleBuffer {

// Get the frame timestamp

CMTime presentationTimeStamp = CMSampleBufferGetOutputPresentationTimeStamp(sampleBuffer); 
int timestamp = presentationTimeStamp.value/(presentationTimeStamp.timescale/1000);

// Send the frame

CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
[upstream sendFrame:pixelBuffer timestamp:timestamp];
}

#pragma mark-

#pragma mark IMediaStreamEvent Methods

-(void)stateChanged:(id)sender state:(int)state description:(NSString *)description {

NSLog(@" $$$$$$ <IMediaStreamEvent> stateChangedEvent: %d = %@", (int)state, description);    

switch (state) {            
    case CONN_DISCONNECTED: 
    {
        [self disconnectPublish];            
        break;
    }            
    case CONN_CONNECTED: 
    case STREAM_PAUSED: 
    {
        [self startPublish];
        break;
    }            
    case STREAM_PLAYING: 
    {
        break;
    }
    default:
        break;
}

}

-(void)connectFailed:(id)sender code:(int)code description:(NSString *)description {

NSLog(@" $$$$$$ <IMediaStreamEvent> connectFailedEvent: %d = %@\n", code, description);    

if (code > 0)
    [self disconnectPublish];

}

@EnD

  1. In updateVideoViewWithFrame: method of DroneVideoView class you have

    CMSampleBufferRef sbRef = NULL;
    

which is used for frame rendering below:

    dispatch_async(dispatch_get_main_queue(),^{
        [_videoLayer enqueueSampleBuffer:sbRef];
        [_videoLayer setNeedsDisplay];

Thus, sbRef is the structure which you should use for RTMP publishing with sendFrame: method (above)
-(void)sendFrame:(CMSampleBufferRef)sampleBuffer;

Regards,
Slava

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Hi Slava,

Thankyou, I will try and let you know

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Hi Slava,

The VIDEO_CUSTOM mode does not seem to work. I have made the changes suggested by you but still I'm neither able to connect nor view the drone video on Wowza with VIDEO_CUSTOM mode. If you have an updated sample, please do share.

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Hi,

Is there any updated sample with VIDEO_CUSTOM mode successfully working?

Thanks in advance

from medialibdemos3x.

slavavdovichenko avatar slavavdovichenko commented on August 16, 2024

Hi,

Yes, I have done the sample app for VIDEO_CUSTOM mode.
You can get it from github -
https://github.com/slavavdovichenko/MediaLibDemos3x (RTMPPhotoPublish
target).
Also you must update the fixed CommLibiOS.a & MediaLibiOS.a from this repo.

Slava

On Mon, Jun 29, 2015 at 3:02 PM, sdave28jul [email protected]
wrote:

Hi,

Is there any updated sample with VIDEO_CUSTOM mode successfully working?

Thanks in advance


Reply to this email directly or view it on GitHub
#27 (comment)
.

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Hi,

I'm successfully able to stream to Wowza with the RTMPPhotoPublisher sample.

I have made changes in my project for my requirement to stream drone video to Wowza however I see only a black screen when the stream is playing on wowza.

I have mailed you the changes I have made, can you please check and help out?

Thanks in advance.

from medialibdemos3x.

sdave28jul avatar sdave28jul commented on August 16, 2024

Follwing up, if there is any help possible for above requirement.

from medialibdemos3x.

slavavdovichenko avatar slavavdovichenko commented on August 16, 2024

Hi,
you can try fixed RTMPPhotoPublisher app -> https://github.com/slavavdovichenko/MediaLibDemos3x

from medialibdemos3x.

slavavdovichenko avatar slavavdovichenko commented on August 16, 2024

I think you have to investigate this issue - http://stackoverflow.com/questions/29525000/how-to-use-videotoolbox-to-decompress-h-264-video-stream/29525001#29525001
because to integrate the drone stream with the rtmp stream you need the uncompressed data, thus VTDecompressionSession have to be used.

from medialibdemos3x.

reenaphilip avatar reenaphilip commented on August 16, 2024

I have decompressed using VTDecompressionSession and tried to stream the CGImageRef. But whats the timeStamp which I have to send along with the CGImageRef

from medialibdemos3x.

vivek1608 avatar vivek1608 commented on August 16, 2024

When i Run And click on connnect then popup come "connectfailedEvent:fault code = -1 < Input or/and Output Stream is not Opened (-1)">

from medialibdemos3x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.