Code Monkey home page Code Monkey logo

Comments (3)

soyersoyer avatar soyersoyer commented on August 26, 2024

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.

sl13 avatar sl13 commented on August 26, 2024

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.

soyersoyer avatar soyersoyer commented on August 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.