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

Stream output to memory buffer #108

Open
MrMarble opened this issue Sep 4, 2023 · 1 comment
Open

Stream output to memory buffer #108

MrMarble opened this issue Sep 4, 2023 · 1 comment

Comments

@MrMarble
Copy link

MrMarble commented Sep 4, 2023

Is there a way to get the output stream?

I'd like to buffer some video for manual playing, currently I use --sout #std{mux=ts,access=file,dst=-} to output the data to the console and capture it manually to then use it as a buffer.

It would be better to access the stream directly, like with https://wiki.videolan.org/Documentation:Modules/smem/, but I'm not sure on how to do it (or if it's even possible)

@leroymusa
Copy link

Yes, you can use the smem module to capture the output stream directly into memory. Here's the approach:

vlc input_file --sout "#transcode{vcodec=RV24,acodec=s16l}:smem{video-prerender-callback=video_callback,audio-prerender-callback=audio_callback}"

You’ll need to implement the video_callback and audio_callback functions to handle the stream data. These callbacks give you direct access to the video and audio buffers in memory for manual processing. This avoids writing to the console or a file.

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