Comments (3)
I used to think about this as well.
GStreamer also has an mjpegh264 demuxer, maybe that is more suitable for you.
https://gstreamer.freedesktop.org/documentation/uvch264/uvch264mjpgdemux.html
But with this code:
Initalize the camera and such like in fmp4streamer.py, create an MP4Writer instead of Streamingserver,
use sys.stdout instead of self.wfile
mp4_writer = MP4Writer(self.wfile, config.width(), config.height(), config.rotation(), config.timescale(), h264parser.sps, h264parser.pps)
while True:
nalus, frame_secs, frame_usecs = h264parser.read_frame()
mp4_writer.add_frame(nalus, frame_secs, frame_usecs)
from fmp4streamer.
Thank you very much for your help. Unfortunately, I can't get either of the two variants to work. I have carried out some tests for the gstreamer variant. The following two pieplines work without problems.
gst-launch-1.0 -v v4l2src device=/dev/video0 ! "video/x-raw, width=640,height=480,framerate=30/1" ! videoconvert ! autovideosink
gst-launch-1.0 -v v4l2src device=/dev/video0 ! "image/jpeg,parsed=true,width=640,height=480" ! jpegdec ! videoconvert ! autovideosink
But when I add the demuxer "uvch264mjpgdemux" to the piepline it doesn't work.
gst-launch-1.0 -v v4l2src device=/dev/video0 ! "image/jpeg,parsed=true,width=640,height=480" ! uvch264mjpgdemux ! "video/x-h264,width=640,height=480,framerate=30/1" ! avdec_h264 ! videoconvert ! autovideosink
The following error report is displayed:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0";
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = image/jpeg, parsed=(boolean)true, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = image/jpeg, parsed=(boolean)true, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstUvcH264MjpgDemux:uvch264mjpgdemux0.GstPad:jpeg: caps = image/jpeg, parsed=(boolean)true, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstUvcH264MjpgDemux:uvch264mjpgdemux0.GstPad:sink: caps = image/jpeg, parsed=(boolean)true, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, colorimetry=(string)2:4:5:1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = image/jpeg, parsed=(boolean)true, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, colorimetry=(string)2:4:5:1
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-linked (-1)
Execution ended after 0:00:00.315406966
Setting pipeline to NULL ...
Freeing pipeline ...
I know the problem has nothing to do with your software, but do you have any idea what the error could be?
from fmp4streamer.
Maybe these can help:
https://kakaroto.homelinux.net/2012/09/uvc-h264-encoding-cameras-support-in-gstreamer/
https://www.oz9aec.net/software/gstreamer/using-the-logitech-c920-webcam-with-gstreamer-12
from fmp4streamer.
Related Issues (15)
- Add audio from USB microphone HOT 3
- Frame Tearing with a Kiyo Pro at 1080p HOT 4
- Clarify with examples of some popular webcams
- ERROR:root:/dev/video0 H264 format not available with RPi 4 and RPi Camera V2 HOT 1
- Trouble when starting fmp4streamer HOT 3
- Port 80 unusable?
- Latency HOT 2
- Allow camera to be turned on/off HOT 1
- getting error whenever trying to stream through raspberry pi HOT 11
- Error HOT 13
- IP Camera Adapter HOT 1
- Logitech C920 no H264 on Pi Zero W HOT 5
- ISO 14496 HOT 2
- ERROR:root:/dev/video0 H264 format not available HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmp4streamer.