Skip to content
New issue

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

feature request: constructor for Socket, use input stream as source of video data #507

Open
ohdonpiano opened this issue Sep 18, 2024 · 1 comment

Comments

@ohdonpiano
Copy link

I'm currently developing a flutter app that allows to view security live streams with RTSP protocol.
The proprietary APIs requires that, when the streaming has to be started, a TCP SecureSocket has to be created, using a certificate. Then, some bytes has to be sent as a command, and the server starts to responds packets until the socket is closed.

on native iOS, VLCMediaPlayer of MobileVLCKit pod allows to create such socket input:

VLCplayer.media = [[VLCMedia alloc] initWithStream:camera_to_stream._video_stream];

stream being an instance of NSInputStream

`
/**

  • Initializes a new VLCMedia object to use an input stream.
  • \note By default, NSStream instances that are not file-based are non-seekable,
  • you may subclass NSInputStream whose instances are capable of seeking through a stream.
  • This subclass must allow setting NSStreamFileCurrentOffsetKey property.
  • \note VLCMedia will open stream if it is not already opened, and will close eventually.
  • You can't pass an already closed input stream.
  • \param stream Input stream for media to be accessed.
  • \return A new VLCMedia object, only if there were no errors.
    */
  • (instancetype)initWithStream:(NSInputStream *)stream;
    `

On Android, using ExoPlayer, a similar approach can be done:

Uri tsVideoUri = Uri.parse("stream.ts"); DataSource.Factory pMyDataSourceFactory = () -> mDataSource; MediaSource pMyMediaSource = new ProgressiveMediaSource.Factory(pMyDataSourceFactory).createMediaSource(tsVideoUri);

mDataSource is an instance of a class that implements DataSource and makes use of a CircularByteBuffer, the data received from the socket is being written inside this data source.

Is this approach already available on flutter_vlc_player?

@ge0rge000
Copy link

i have solution that return video from youtybe without know that video come from youtybe and all quality work and other function contact me on whatsapp:+971557474526

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants