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 Suggestion: Stream Fallback Source #4

Closed
chron0 opened this issue Apr 13, 2019 · 9 comments
Closed

Feature Suggestion: Stream Fallback Source #4

chron0 opened this issue Apr 13, 2019 · 9 comments
Assignees
Labels
resolution:fixed Fixed type:feature New feature or request

Comments

@chron0
Copy link

chron0 commented Apr 13, 2019

I'll just throw it in here for discussion: Wouldn't it be a good benefit to have a fallback option for the streamer, if the USB device is disconnected or doesn't stream data anymore, to have an option to detect source disconnection/stream-stall and stream either a JPG as fallback "source" or loop an mjpg video instead...

@mdevaev
Copy link
Member

mdevaev commented Apr 13, 2019

You can try to pull out the camera wire during a stream right now and see image with "NO SIGNAL". The broadcast will resume if the wire is connected again. Is this what you want?

@chron0
Copy link
Author

chron0 commented Apr 13, 2019

Only half of it. This is already better than mjpg-streamer but I'd imagine a --fallback-jpg or --fallback-mjpg option, where we can give the path of a jpg file to show instead of the "NO SIGNAL" or the path to a video file (mjpg to keep things simple) that would be looped instead until the signal returns.

@mdevaev
Copy link
Member

mdevaev commented Apr 13, 2019

I can make the --fallback-jpg option, but not --fallback-mjpg, because in fact the MJPG is not a pure video format and it cannot exist as file outside the HTTP protocol. This is a sequence of frames, each of which is an independent JPEG file. The server determines all broadcast parameters, for example, the delay between frames.

@chron0
Copy link
Author

chron0 commented Apr 13, 2019

MJPG can very well be a video format outside of HTTP, see https://www.redsharknews.com/production/item/3209-why-would-canon-use-mjpeg-for-video-in-the-new-1-dx-mk-ii

Resolution would be up to the user to match to the stream and the "player" would just loop thru each frame in the specified framerate of the stream.

@mdevaev mdevaev added the type:feature New feature or request label Apr 13, 2019
@mdevaev
Copy link
Member

mdevaev commented Apr 13, 2019

Oookay that's interesting. Sounds like non-standard format. https://en.wikipedia.org/wiki/Motion_JPEG#Disadvantages

Unlike the video formats specified in international standards such as MPEG-2 and the format specified in the JPEG still-picture coding standard, there is no document that defines a single exact format that is universally recognized as a complete specification of “Motion JPEG” for use in all contexts. This raises compatibility concerns about file outputs from different manufacturers. However, each particular file format usually has some standard on how M-JPEG is encoded. For example, Microsoft documents their standard format to store M-JPEG in AVI files,[6] Apple documents how M-JPEG is stored in QuickTime files, RFC 2435 describes how M-JPEG is implemented in an RTP stream, and an M-JPEG CodecID is planned for the Matroska file format.

@chron0
Copy link
Author

chron0 commented Apr 13, 2019

ye, currently it's mostly wrapped in mov files.

@mdevaev
Copy link
Member

mdevaev commented Apr 13, 2019

Ok, I'll do the first option, but I'm not sure about the second one. It will complicate the already complex server too much. At least as I imagine it now.

@mdevaev
Copy link
Member

mdevaev commented Apr 14, 2019

Try it. Option -k/--blank <path/to/file.jpg>. I made it without handling some errors, but should work quite well.

@mdevaev
Copy link
Member

mdevaev commented Apr 17, 2019

@chron0 I added error handling, now this feature is done.

@mdevaev mdevaev closed this as completed Apr 30, 2019
@mdevaev mdevaev self-assigned this May 17, 2019
mdevaev pushed a commit that referenced this issue Oct 22, 2022
* Support multiple (audio+video) streams in demo janus client (#4)

* Support multiple (audio+video) streams in demo janus client

* Adjust wording in H264 guide

* Use consistent braces style

Co-authored-by: Louis Goessling <louis@goessling.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:fixed Fixed type:feature New feature or request
Development

No branches or pull requests

2 participants