Live streaming a web page with video/audio elements - linux

i am trying to do a website/browser livestream on a headless linux, but couldn't find a good solution yet.
Headful example: In OBS Studio you can add a Browser Source of a web page that includes video/audio and stream this content live out.
So what i basically want is like a headless version of this.
I tried a bit with phantomjs and chrome-headless, but these tools are not supporting video or audio outputs in headless mode. If there is an alternative that can output a web page stream with video/audio would be awesome.
This output can then piped to ffmpeg and launch a rtmp stream :)
Thanks!

Related

Recording audio on the web and sending the data to Android app

I want to capture audio in the Chrome web browser using MediaRecorder and send the encoded audio data to the Android app for playback in real-time.
I can't find any audio format that is supported on both sides. I was trying to use opus codec, but Chrome only supports webm container, and Android supports ogg.
What is the proper way of doing this? I don't want to use WebRTC. I could use some data converters/encoders, but all libraries I found are obsolete/abandoned/insecure.
The webm container format is sometimes stored in .mkv files.
Android 5+ eats pretty much any webm the Chromium MediaRecorder class delivers. If you give MediaRecorder a MediaStream that came from getUserMedia(), and ask it for the right MIME type, you'll get Opus boxed inside webm.
const mediaRec = new MediaRecorder(stream, {mimeType: 'audio/webm;codecs=opus'})
If you put that into a file, use name.webm or name.mkv to name it. Android has been able to handle it for a long time now.
The mkvtoolnix program helps you examine these webm files to see what's in them.
If this didn't address your question, please make a comment.

How to go about recording a livestream in python

I'm trying to write a python script to record and save segments of a live stream for research purposes. I know how to do it for mainstream platforms such as YouTube, but I'm not sure how to do it on this site.
Here's the video link:
http://cwwp2.dot.ca.gov/vm/loc/d3/hwy80atdonnersummit.htm
Thanks for your help!
Its not "recording" a video its just downloading. That site uses HLS. Any HLS downloader should work. But you need to get the URL form the m3u8 file.
Start by viewing the network tab of the browser, and the sites source code, You can then see how the browser plays it, then develop your script from that.

How to play RTSP on Google TV ( or use ffmpeg )

In short, I have to play RTSP on a Google TV device (Sony nsz-gs7). How can I do it?
Things I tried:
Use NDK to compile ffmpeg, then ffmpeg converts rtsp to udp etc. - Fails because NDK is not supported in Google TV (see: https://developers.google.com/tv/faq#ndk). This method uses ffmpeg as library.
Put ffmpeg executable (compiled with NDK) in an application, then call the app from command line. (see: http://gimite.net/en/index.php?Run%20native%20executable%20in%20Android%20App - first method). I can deploy executable and set its permissions, but cannot execute it; i get "not found" error (its path is correct). If only I could run an executable file in Google TV, the problem would be solved, I think.
Tried to display in VideoView, like Google TV VideoView playing YouTube rtsp videos, it didn't work either.
These approaches all work on Android phones, but I couldn't make them work on Google TV.
Any tips for displaying RTSP or running executable files? Or do I have to wait for NDK support?
Update: If there is an application which can play RTSP streams, we can also use it as a temporary fix.
The current version of Google TV is based on FFMpeg internally and is supposed to play RTSP content of course, if you try that example, you'll want to refresh the url for the RTSP content as YouTube doesn't keep them live long. Since RTSP is a transport format, not a codec, you might want to say what your encoding is.
That said, I've never made RTSP work myself - so I'm not speaking from experience, but I do trust my colleague Shawn who wrote the answer to the link above.
One of the features we announced at Google I/O 2012 was the ability to write your own transport stream and codec's in Java. That software is currently on the LG and will be on most of the others in the next few months.
If your need is urgent write me at Google or on Google+.

rtp and rtsp player integration to browser

I am trying to build a web service that will stream music over a web browser.
I got a server running to open up a web page that says "hello world".
The problem is that I do not understand what I need to put in the web page to start a rtp session.
I understand that I need some sort of player on the web page I'm opening but I do not understand how to make that player or how to show it up on the web page.
can someone help me?
A little late to the party here, but ...
You will need a player of some kind.
Currently, the browsers do not support playing a live RTP stream. I've done some work in this area and it has required that I transcode the video to FLV for it to be viewable in many of the free flash players (i.e. JWPlayer, Flowplayer, etc.).
You could also write a custom browser plugin to read the RTP stream and display it in the browser but that would be sizeable undertaking.

Play Apple's .caf audio file on a webserver?

Play Apple's .caf audio file on a webserver? I have .caf audio files (Apple's open audio format) stored on my webserver and want to play them from a web browser on any O/S.
I understand, this doesn't seem like the solution you're looking for, but...
Several weeks ago we faced the same problem. We have several clients which are posting audio files to the web site from theirs iPhones, and we need to play audios on the web site.
But we didn't find any suitable flash player with .caf format support.
So we decided to convert .caf to .mp3 on the server through the ffmpeg.exe utility.
Happily, there a lot of flash players with .mp3 support.
Now I have not tried this... but...
This website:
http://modmyi.com/forums/skinning-themes-discussion/1769-how-do-i-create-caf-file.html
Seems to suggest that .CAF and .AIF may work interchangeably (It suggests that to convert to .CAF you convert to .AIF` and then rename the file).
Have you tried renaming it to .AIF and trying to play in a flash/java browser player? Alternatively just send it as a stream to the web-browser and let the client OS work out what to do with it (Like quicktime running inside the browser).
Let me know how it goes.

Resources