<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">Le 9 mars 2017 1:50 PM, "Vivia Nikolaidou" <<a href="mailto:n.vivia@gmail.com">n.vivia@gmail.com</a>> a écrit :<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
You can try without the jpegparse element, it's likely changing the timestamps.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">That's a good idea, you should try.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Also, why do you have that videorate element there? If there's no<br>
capsfilter around it and there are no arguments to it, it's probably<br>
not doing much.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Videorate is useful since cameras will produce lower rate then expected in low light. Having later dynamic rate is just a pain for post processing.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best regards,<br>
<br>
Vivia<br>
<div class="elided-text"><br>
On 9 March 2017 at 18:48, Damien Picard <<a href="mailto:picard.damien@gmail.com">picard.damien@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I'm currenlty discovering GStreamer and I am looking for a way to capture<br>
> and encode my UVC webcam to H264 stream in a MP4 container.<br>
><br>
> I am able to achieve it using this command :<br>
><br>
> gst-launch-1.0 -e v4l2src device=/dev/video0 !<br>
> 'image/jpeg,width=1920,height=<wbr>1080' !  jpegparse ! jpegdec ! videoconvert !<br>
> videorate ! x264enc ! mp4mux ! filesink location=videotestsrc.mp4<br>
><br>
> It does the job but the resulting videotestsrc.mp4 does not seem to have the<br>
> right framerate because the video is "accelerated".<br>
> I think it could be caused by two things :<br>
>  - The framerate in the resulting video is actually not the good one, but<br>
> I'm not able to diagnose and fix it ; do you have some tricks to achieve<br>
> this ?<br>
>  - The capture step does not capture the whole 30 frames per seconds (for a<br>
> reason that I don't understand) and, in the resulting video, only the<br>
> captured frames are displayed, at 30 fps ; involving that the video seems to<br>
> be accelerated.<br>
><br>
> Some tests I do :<br>
>  - decrease the frame size : leads to the same result<br>
> gst-launch-1.0 -e v4l2src device=/dev/video0 !<br>
> 'image/jpeg,width=640,height=<wbr>480' !  jpegparse ! jpegdec ! videoconvert !<br>
> videorate ! x264enc ! mp4mux ! filesink location=videotestsrc.mp4<br>
>  - record with mjpeg-streamer : works fine, the avi is played at 30 fps, not<br>
> accelerated (the AVI is definitively too large in MJPEG)<br>
> ./mjpg_streamer -i 'input_uvc.so -r 1920x1080' -o 'output_file.so -f<br>
> /home/dams -m video.avi'<br>
><br>
><br>
> The debug output, in 1920x1080 :<br>
><br>
> Définition du pipeline à PAUSED...<br>
> Le pipeline est actif et n’a pas besoin de phase PREROLL…<br>
> Passage du pipeline à la phase PLAYING…<br>
> New clock: GstSystemClock<br>
> /GstPipeline:pipeline0/<wbr>GstV4l2Src:v4l2src0.GstPad:<wbr>src: caps = "image/jpeg\,\<br>
> width\=\(int\)1920\,\ height\=\(int\)1080\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ colorimetry\=\(string\)2:4:7:<wbr>1\,\<br>
> framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstCapsFilter:capsfilter0.<wbr>GstPad:src: caps =<br>
> "image/jpeg\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ colorimetry\=\(string\)2:4:7:<wbr>1\,\<br>
> framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstJpegParse:jpegparse0.<wbr>GstPad:sink: caps =<br>
> "image/jpeg\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ colorimetry\=\(string\)2:4:7:<wbr>1\,\<br>
> framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstCapsFilter:capsfilter0.<wbr>GstPad:sink: caps =<br>
> "image/jpeg\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ colorimetry\=\(string\)2:4:7:<wbr>1\,\<br>
> framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstJpegParse:jpegparse0.<wbr>GstPad:src: caps =<br>
> "image/jpeg\,\ parsed\=\(boolean\)true\,\ format\=\(string\)UYVY\,\<br>
> width\=\(int\)1920\,\ height\=\(int\)1080\,\ framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstJpegDec:jpegdec0.GstPad:<wbr>sink: caps =<br>
> "image/jpeg\,\ parsed\=\(boolean\)true\,\ format\=\(string\)UYVY\,\<br>
> width\=\(int\)1920\,\ height\=\(int\)1080\,\ framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstJpegDec:jpegdec0.GstPad:<wbr>src: caps =<br>
> "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\<br>
> height\=\(int\)1080\,\ interlace-mode\=\(string\)<wbr>progressive\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,<wbr>\<br>
> colorimetry\=\(string\)1:4:0:<wbr>0\,\ framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstVideoConvert:videoconvert0.<wbr>GstPad:src: caps =<br>
> "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\<br>
> height\=\(int\)1080\,\ interlace-mode\=\(string\)<wbr>progressive\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,<wbr>\<br>
> colorimetry\=\(string\)1:4:0:<wbr>0\,\ framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstVideoRate:videorate0.<wbr>GstPad:src: caps =<br>
> "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\<br>
> height\=\(int\)1080\,\ interlace-mode\=\(string\)<wbr>progressive\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,<wbr>\<br>
> colorimetry\=\(string\)1:4:0:<wbr>0\,\ framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstX264Enc:x264enc0.GstPad:<wbr>sink: caps =<br>
> "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\<br>
> height\=\(int\)1080\,\ interlace-mode\=\(string\)<wbr>progressive\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,<wbr>\<br>
> colorimetry\=\(string\)1:4:0:<wbr>0\,\ framerate\=\(fraction\)30/1"<br>
> Redistribution de latence…<br>
> /GstPipeline:pipeline0/<wbr>GstVideoRate:videorate0.<wbr>GstPad:sink: caps =<br>
> "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\<br>
> height\=\(int\)1080\,\ interlace-mode\=\(string\)<wbr>progressive\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,<wbr>\<br>
> colorimetry\=\(string\)1:4:0:<wbr>0\,\ framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstVideoConvert:videoconvert0.<wbr>GstPad:sink: caps =<br>
> "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\<br>
> height\=\(int\)1080\,\ interlace-mode\=\(string\)<wbr>progressive\,\<br>
> pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,<wbr>\<br>
> colorimetry\=\(string\)1:4:0:<wbr>0\,\ framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstX264Enc:x264enc0.GstPad:<wbr>src: caps =<br>
> "video/x-h264\,\<br>
> codec_data\=\(buffer\)<wbr>01640028ffe1001b67640028acd940<wbr>780227e5c044000003000400000300<wbr>f23c60c65801000568ebecb22c\,\<br>
> stream-format\=\(string\)avc\,<wbr>\ alignment\=\(string\)au\,\<br>
> level\=\(string\)4\,\ profile\=\(string\)high\,\ width\=\(int\)1920\,\<br>
> height\=\(int\)1080\,\ pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\<br>
> framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstMP4Mux:mp4mux0.GstPad:<wbr>video_0: caps =<br>
> "video/x-h264\,\<br>
> codec_data\=\(buffer\)<wbr>01640028ffe1001b67640028acd940<wbr>780227e5c044000003000400000300<wbr>f23c60c65801000568ebecb22c\,\<br>
> stream-format\=\(string\)avc\,<wbr>\ alignment\=\(string\)au\,\<br>
> level\=\(string\)4\,\ profile\=\(string\)high\,\ width\=\(int\)1920\,\<br>
> height\=\(int\)1080\,\ pixel-aspect-ratio\=\(<wbr>fraction\)1/1\,\<br>
> framerate\=\(fraction\)30/1"<br>
> /GstPipeline:pipeline0/<wbr>GstMP4Mux:mp4mux0.GstPad:src: caps =<br>
> "video/quicktime\,\ variant\=\(string\)iso"<br>
> /GstPipeline:pipeline0/<wbr>GstFileSink:filesink0.GstPad:<wbr>sink: caps =<br>
> "video/quicktime\,\ variant\=\(string\)iso"<br>
> ^Chandling interrupt.<br>
> Interruption : arrêt du pipeline…<br>
> EOS à la fermeture est activé -- EOS forcé sur le pipeline<br>
> Attente d’EOS.<br>
> /GstPipeline:pipeline0/<wbr>GstMP4Mux:mp4mux0.GstPad:src: caps =<br>
> "video/quicktime\,\ variant\=\(string\)iso\,\ streamheader\=\(buffer\)\<\<br>
> 00000cdc...\ \>"<br>
> /GstPipeline:pipeline0/<wbr>GstFileSink:filesink0.GstPad:<wbr>sink: caps =<br>
> "video/quicktime\,\ variant\=\(string\)iso\,\ streamheader\=\(buffer\)\<\<br>
> 00000cdc...\ \>"<br>
> EOS reçu de l’élément « pipeline0 ».<br>
> EOS reçu - arrêt du pipeline…<br>
> Execution ended after 0:00:19.789246908<br>
> Définition du pipeline à PAUSED...<br>
> Définition du pipeline à READY (prêt)…<br>
> Définition du pipeline à NULL…<br>
> Libération du pipeline…<br>
><br>
> Informations about the webcam :<br>
><br>
> v4l2-ctl --all<br>
> Driver Info (not using libv4l2):<br>
> Driver name   : uvcvideo<br>
> Card type     : USB 2.0 Camera<br>
> Bus info      : usb-0000:00:1d.0-1.2<br>
> Driver version: 4.4.44<br>
> Capabilities  : 0x84200001<br>
> Video Capture<br>
> Streaming<br>
> Extended Pix Format<br>
> Device Capabilities<br>
> Device Caps   : 0x04200001<br>
> Video Capture<br>
> Streaming<br>
> Extended Pix Format<br>
> Priority: 2<br>
> Video input : 0 (Camera 1: ok)<br>
> Format Video Capture:<br>
> Width/Height      : 1920/1080<br>
> Pixel Format      : 'MJPG'<br>
> Field             : None<br>
> Bytes per Line    : 0<br>
> Size Image        : 4147789<br>
> Colorspace        : sRGB<br>
> Transfer Function : Default<br>
> YCbCr Encoding    : Default<br>
> Quantization      : Default<br>
> Flags             :<br>
> Crop Capability Video Capture:<br>
> Bounds      : Left 0, Top 0, Width 1920, Height 1080<br>
> Default     : Left 0, Top 0, Width 1920, Height 1080<br>
> Pixel Aspect: 1/1<br>
> Selection: crop_default, Left 0, Top 0, Width 1920, Height 1080<br>
> Selection: crop_bounds, Left 0, Top 0, Width 1920, Height 1080<br>
> Streaming Parameters Video Capture:<br>
> Capabilities     : timeperframe<br>
> Frames per second: 30.000 (30/1)<br>
> Read buffers     : 0<br>
>                      brightness (int)    : min=-64 max=64 step=1 default=0<br>
> value=-64<br>
>                        contrast (int)    : min=0 max=64 step=1 default=32<br>
> value=64<br>
>                      saturation (int)    : min=0 max=128 step=1 default=60<br>
> value=128<br>
>                             hue (int)    : min=-40 max=40 step=1 default=0<br>
> value=-40<br>
>  white_balance_temperature_auto (bool)   : default=1 value=1<br>
>                           gamma (int)    : min=72 max=500 step=1 default=100<br>
> value=100<br>
>                            gain (int)    : min=0 max=100 step=1 default=0<br>
> value=100<br>
>            power_line_frequency (menu)   : min=0 max=2 default=1 value=1<br>
>       white_balance_temperature (int)    : min=2800 max=6500 step=1<br>
> default=4600 value=4600 flags=inactive<br>
>                       sharpness (int)    : min=0 max=6 step=1 default=2<br>
> value=2<br>
>          backlight_compensation (int)    : min=0 max=2 step=1 default=1<br>
> value=1<br>
>                   exposure_auto (menu)   : min=0 max=3 default=3 value=3<br>
>               exposure_absolute (int)    : min=1 max=5000 step=1 default=157<br>
> value=157 flags=inactive<br>
>          exposure_auto_priority (bool)   : default=0 value=1<br>
><br>
> I would appreciate any idea.<br>
> Thank you.<br>
><br>
> --<br>
> Damien Picard<br>
> Expert GWT<br>
> Mob : 06 11 51 47 78<br>
><br>
</div>> ______________________________<wbr>_________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
><br>
______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
</blockquote></div><br></div></div></div>