Recode a motion-jpeg stream into mpeg-ts?

Christophe Lohr christophe.lohr at cegetel.net
Fri Feb 8 21:05:25 UTC 2019


Le 06/02/2019 à 14:53, Antonio Ospite a écrit :
> you'll have to add videoscale as well next to videoconvert (also add
> videorate if you are changing the framerate too).

Let's keep the same resolution for now (each step one after the other ;)

But I wonder if there is an intrinsic issue about the frame rate...

$ gst-launch-1.0 -v uridecodebin uri=http://192.168.3.55/mjpg/video.mjpg
! queue ! videorate ! video/x-raw, framerate=5/1 ! videoconvert !
avenc_mpeg2video ! filesink location=test.mpg

/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps =
video/x-raw, format=(string)I420, width=(int)1280, height=(int)800,
interlace-mode=(string)progressive, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2,
colorimetry=(string)1:4:0:0, framerate=(fraction)5/1
/GstPipeline:pipeline0/GstVideoRate:videorate0.GstPad:sink: caps =
video/x-raw, format=(string)I420, width=(int)1280, height=(int)800,
interlace-mode=(string)progressive, multiview-mode=(string)mono,
multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono,
pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)mpeg2,
colorimetry=(string)1:4:0:0, framerate=(fraction)0/1
buffering... 0% 

and this stay at 0% !


Indeed, the original motion-jpeg stream has no frame rate.
To be more precise, the network-cam produces pictures at an actual rate
varying from 5.5 fps to 6.5 fps...

I expected that the "queue" could compensate the jitter... but there
should be something else more complicated to do ;-)
Does someone has an example on how to manage a mjpeg source an recode it
to something else?

Best regards
Christophe




More information about the gstreamer-devel mailing list