Recherche avancée

Médias (91)

Autres articles (67)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (5953)

  • Gstreamer channel reordering failed

    31 octobre 2017, par user972851

    I installed the library essentia which causes my previously working pipeline to crash :

    ** (gst-launch-1.0:22515): CRITICAL **: gst_audio_reorder_channels: assertion 'size % ((info->width * channels) / 8) == 0' failed
    ERROR: from element /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0: Channel reordering failed.
    Additional debug info:
    gstrtpL16depay.c(276): gst_rtp_L16_depay_process (): /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0

    The pipeline looks like this :

    udpsrc port=5000 ! application/x-rtp,media=(string)audio,channels=1, clock-rate=(int)44100,encoding-name=(string)L16,payload=10 ! rtpL16depay ! audioconvert ! tee name=t ! queue ! autoaudiosink sync=false t. ! queue ! appsink name=codesink

    I am using gstreamer 1.0 on Ubuntu 16.04 and (re-)installed the libraries mentioned in the essentia doc :

    build-essential libyaml-dev libfftw3-dev libavcodec-dev libavformat-dev libavutil-dev libavresample-dev python-dev libsamplerate0-dev libtag1-dev
    python-numpy-dev python-numpy python-yaml
    ffmpeg

    The essentia install script finished ’successfully’ even though I cannot find MonoLoader or any other Audioloader.... (so still something wrong with essentia as well, but thats not the main problem !)


    Cleaned out parts of the gstreamer debug log look like this :

    0:00:00.149495849 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin106>[00m g_dir_open(/dev/v4l2) failed: Error opening directory '/dev/v4l2': No such file or directory
    0:00:00.149807870 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/home/xxx/.frei0r-1/lib) failed: Error opening directory '/home/xxx/.frei0r-1/lib': No such file or directory
    0:00:00.149823765 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/lib/x86_64-linux-gnu/frei0r-1) failed: Error opening directory '/usr/lib/x86_64-linux-gnu/frei0r-1': No such file or directory
    0:00:00.149836069 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/lib/frei0r-1) failed: Error opening directory '/usr/lib/frei0r-1': No such file or directory
    0:00:00.149847527 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/local/lib/frei0r-1) failed: Error opening directory '/usr/local/lib/frei0r-1': No such file or directory
    0:00:00.149859202 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/lib32/frei0r-1) failed: Error opening directory '/usr/lib32/frei0r-1': No such file or directory
    0:00:00.149870221 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/local/lib32/frei0r-1) failed: Error opening directory '/usr/local/lib32/frei0r-1': No such file or directory
    0:00:00.149881462 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/lib64/frei0r-1) failed: Error opening directory '/usr/lib64/frei0r-1': No such file or directory
    0:00:00.149893070 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstplugin.c:1549:gst_plugin_ext_dep_scan_dir_and_match_names:<plugin223>[00m g_dir_open(/usr/local/lib64/frei0r-1) failed: Error opening directory '/usr/local/lib64/frei0r-1': No such file or directory

    0:00:00.186559327 [334m22515[00m       0xf93a80 [33;01mWARN   [00m [00m         rtpL16depay gstrtpL16depay.c:276:gst_rtp_L16_depay_process:<rtpl16depay0>[00m error: Channel reordering failed.
    0:00:00.186574584 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01;37;41m         GST_MESSAGE gstelement.c:1848:gst_element_message_full:<rtpl16depay0>[00m start
    0:00:00.186589070 [334m22515[00m       0xf93a80 [36mINFO   [00m [00;01;31;47m    GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<rtpl16depay0>[00m posting message: Channel reordering failed.
    0:00:00.186619665 [334m22515[00m       0xf93a80 [33;01mWARN   [00m [00m           structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'
    0:00:00.186613247 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:311:gst_bus_post:<bus1>[00m [msg 0xfc44c0] posting on bus error message: 0xfc44c0, time 99:99:99.999999999, seq-num 59, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";
    0:00:00.186641091 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01m                 bin gstbin.c:3533:gst_bin_handle_message_func:<pipeline0>[00m [msg 0xfc44c0] handling child rtpl16depay0 message of type error
    0:00:00.186649484 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01m                 bin gstbin.c:3540:gst_bin_handle_message_func:<pipeline0>[00m got ERROR message, unlocking state change
    0:00:00.186656312 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01m                 bin gstbin.c:3870:gst_bin_handle_message_func:<pipeline0>[00m posting message upward
    0:00:00.186665962 [334m22515[00m       0xf93a80 [33;01mWARN   [00m [00m           structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'
    0:00:00.186662657 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:311:gst_bus_post:<bus2>[00m [msg 0xfc44c0] posting on bus error message: 0xfc44c0, time 99:99:99.999999999, seq-num 59, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";
    0:00:00.186688725 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:350:gst_bus_post:<bus2>[00m [msg 0xfc44c0] pushing on async queue
    0:00:00.186706354 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:353:gst_bus_post:<bus2>[00m [msg 0xfc44c0] pushed on async queue
    0:00:00.186713847 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:346:gst_bus_post:<bus1>[00m [msg 0xfc44c0] dropped
    0:00:00.186720541 [334m22515[00m       0xf93a80 [36mINFO   [00m [00;01;31;47m    GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<rtpl16depay0>[00m posted error message: Channel reordering failed.
    0:00:00.186729277 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01;34m          GST_MEMORY gstmemory.c:87:_gst_memory_free:[00m free memory 0x7f7780004b80
    0:00:00.186737518 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01;35m      GST_SCHEDULING gstpad.c:4192:gst_pad_chain_data_unchecked:[00m called chainfunction &amp;0x7f77a1a9ae00 with buffer 0x7f7780016060, returned ok
    0:00:00.186746868 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01;35m      GST_SCHEDULING gstpad.c:4192:gst_pad_chain_data_unchecked:[00m called chainfunction &amp;gst_base_transform_chain with buffer 0x7f7780016060, returned ok
    0:00:00.186734973 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:523:gst_bus_timed_pop_filtered:<bus2>[00m got message 0xfc44c0, error from rtpl16depay0, type mask is 4294967295
    0:00:00.186759208 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00m             basesrc gstbasesrc.c:2456:gst_base_src_get_range:<udpsrc0>[00m calling create offset 18446744073709551615 length 4096, time 0
    0:00:00.186808915 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01;34m          GST_MEMORY gstmemory.c:138:gst_memory_init:[00m new memory 0x7f7780017ae0, maxsize:901 offset:0 size:894
    0:00:00.186812210 [334m22515[00m       0xd96a00 [33;01mWARN   [00m [00m           structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'
    0:00:00.186798035 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:791:gst_bus_source_dispatch:<bus2>[00m source 0xfc0b60 calling dispatch with error message: 0xfc44c0, time 99:99:99.999999999, seq-num 59, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";


    0:00:00.187438285 [334m22515[00m       0xf93a80 [33;01mWARN   [00m [00m         rtpL16depay gstrtpL16depay.c:276:gst_rtp_L16_depay_process:<rtpl16depay0>[00m error: Channel reordering failed.

    0:00:00.187861496 [334m22515[00m       0xf93a80 [36mINFO   [00m [00;01;31;47m    GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<rtpl16depay0>[00m posting message: Channel reordering failed.
    0:00:00.187870817 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;31m          GST_STATES gstelement.c:2523:gst_element_set_state_func:<autoaudiosink0>[00m set_state to PAUSED
    0:00:00.187917831 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;31m          GST_STATES gstelement.c:2561:gst_element_set_state_func:<autoaudiosink0>[00m current READY, old_pending PAUSED, next PAUSED, old return ASYNC
    0:00:00.187926145 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;31m          GST_STATES gstelement.c:2615:gst_element_set_state_func:<autoaudiosink0>[00m element was busy with async state change
    0:00:00.187931662 [334m22515[00m       0xf93a80 [33;01mWARN   [00m [00m           structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'
    0:00:00.187932562 [334m22515[00m       0xd96a00 [36mINFO   [00m [00;01;31m          GST_STATES gstbin.c:2770:gst_bin_change_state_func:<pipeline0>[00m child 'autoaudiosink0' is changing state asynchronously to PAUSED
    0:00:00.187919799 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:311:gst_bus_post:<bus1>[00m [msg 0xfc4540] posting on bus error message: 0xfc4540, time 99:99:99.999999999, seq-num 60, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";
    0:00:00.187957346 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01m                 bin gstbin.c:2182:gst_bin_sort_iterator_next:<pipeline0>[00m queue head gives queue0
    0:00:00.187965818 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01m                 bin gstbin.c:3533:gst_bin_handle_message_func:<pipeline0>[00m [msg 0xfc4540] handling child rtpl16depay0 message of type error
    0:00:00.187975510 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01m                 bin gstbin.c:882:find_message:<pipeline0>[00m no message found matching types 00001000
    0:00:00.187996861 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01m                 bin gstbin.c:889:find_message:<pipeline0>[00m   structure-change
    0:00:00.188003444 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01m                 bin gstbin.c:2098:update_degree:<pipeline0>[00m change element audioconvert0, degree 1->0, linked to queue0
    0:00:00.188010702 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01m                 bin gstbin.c:1981:add_to_queue:<pipeline0>[00m adding 'audioconvert0' to queue
    0:00:00.188019716 [334m22515[00m       0xd96a00 [36mINFO   [00m [00;01;31m          GST_STATES gstbin.c:2316:gst_bin_element_set_state:<queue0>[00m current PLAYING pending VOID_PENDING, desired next PAUSED
    0:00:00.188021589 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;01m                 bin gstbin.c:3540:gst_bin_handle_message_func:<pipeline0>[00m got ERROR message, unlocking state change

    0:00:00.188204142 [334m22515[00m       0xf93a80 [33;01mWARN   [00m [00m           structure gststructure.c:1935:priv_gst_structure_append_to_gstring:[00m No value transform to serialize field 'gerror' of type 'GError'

    0:00:00.188196343 [334m22515[00m       0xf93a80 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:311:gst_bus_post:<bus2>[00m [msg 0xfc4540] posting on bus error message: 0xfc4540, time 99:99:99.999999999, seq-num 60, element 'rtpl16depay0', GstMessageError, gerror=(GError)NULL, debug=(string)"gstrtpL16depay.c\(276\):\ gst_rtp_L16_depay_process\ \(\):\ /GstPipeline:pipeline0/GstRtpL16Depay:rtpl16depay0";

    0:00:00.188532703 [334m22515[00m       0xf93a80 [36mINFO   [00m [00;01;31;47m    GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<rtpl16depay0>[00m posted error message: Channel reordering failed.

    0:00:00.199466751 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;43m             GST_BUS gstbus.c:523:gst_bus_timed_pop_filtered:<bus2>[00m got message 0xfc4540, error from rtpl16depay0, type mask is 4294967295

    0:00:00.203389413 [334m22515[00m       0xd96a00 [37mDEBUG  [00m [00;01;36m  GST_PLUGIN_LOADING gstpluginfeature.c:66:gst_plugin_feature_finalize:[00m finalizing feature 0xf69ea0: 'errorignore'
    </bus2></rtpl16depay0></bus2></pipeline0></queue0></pipeline0></pipeline0></pipeline0></pipeline0></pipeline0></pipeline0></bus1></pipeline0></autoaudiosink0></autoaudiosink0></autoaudiosink0></rtpl16depay0></rtpl16depay0></bus2></udpsrc0></bus2></rtpl16depay0></bus1></bus2></bus2></bus2></pipeline0></pipeline0></pipeline0></bus1></rtpl16depay0></rtpl16depay0></rtpl16depay0></plugin223></plugin223></plugin223></plugin223></plugin223></plugin223></plugin223></plugin223></plugin106>
  • How to get .mp4 videos from motion on a Raspberry Pi ?

    3 novembre 2017, par Maarti

    I use motion on my laptop and it works perfectly in any format. But when I use it on my Raspberry Pi 3 (Raspbian Jessie) with the Raspberry Camera V2, the only formats that work are : .avi and .swf.

    When I choose any other format, the output video is a "0 sec video" that is played and closed instantly.

    I would like to have .mp4 or .ogg output so I can read it easily with HTML5.

    Here is the motion codec documentation.

    Here is my config file :

    ############################################################
    # Daemon
    ############################################################

    # Start in daemon (background) mode and release terminal (default: off)
    daemon on

    # File to store the process ID, also called pid file. (default: not defined)
    process_id_file /var/run/motion/motion.pid

    ############################################################
    # Basic Setup Mode
    ############################################################

    # Start in Setup-Mode, daemon disabled. (default: off)
    setup_mode off


    # Use a file to save logs messages, if not defined stderr and syslog is used. (default: not defined)
    #logfile /mnt/camshare/Cam1/motion.log
    logfile /tmp/motion.log

    # Level of log messages [1..9] (EMR, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL). (default: 6 / NTC)
    log_level 2

    # Filter to log messages by type (COR, STR, ENC, NET, DBL, EVT, TRK, VID, ALL). (default: ALL)
    log_type all

    ###########################################################
    # Capture device options
    ############################################################

    # Videodevice to be used for capturing  (default /dev/video0)
    # for FreeBSD default is /dev/bktr0
    #videodevice /dev/video0

    # v4l2_palette allows to choose preferable palette to be use by motion
    # to capture from those supported by your videodevice. (default: 17)
    # E.g. if your videodevice supports both V4L2_PIX_FMT_SBGGR8 and
    # V4L2_PIX_FMT_MJPEG then motion will by default use V4L2_PIX_FMT_MJPEG.
    # Setting v4l2_palette to 2 forces motion to use V4L2_PIX_FMT_SBGGR8
    # instead.
    #
    # Values :
    # V4L2_PIX_FMT_SN9C10X : 0  'S910'
    # V4L2_PIX_FMT_SBGGR16 : 1  'BYR2'
    # V4L2_PIX_FMT_SBGGR8  : 2  'BA81'
    # V4L2_PIX_FMT_SPCA561 : 3  'S561'
    # V4L2_PIX_FMT_SGBRG8  : 4  'GBRG'
    # V4L2_PIX_FMT_SGRBG8  : 5  'GRBG'
    # V4L2_PIX_FMT_PAC207  : 6  'P207'
    # V4L2_PIX_FMT_PJPG    : 7  'PJPG'
    # V4L2_PIX_FMT_MJPEG   : 8  'MJPEG'
    # V4L2_PIX_FMT_JPEG    : 9  'JPEG'
    # V4L2_PIX_FMT_RGB24   : 10 'RGB3'
    # V4L2_PIX_FMT_SPCA501 : 11 'S501'
    # V4L2_PIX_FMT_SPCA505 : 12 'S505'
    # V4L2_PIX_FMT_SPCA508 : 13 'S508'
    # V4L2_PIX_FMT_UYVY    : 14 'UYVY'
    # V4L2_PIX_FMT_YUYV    : 15 'YUYV'
    # V4L2_PIX_FMT_YUV422P : 16 '422P'
    # V4L2_PIX_FMT_YUV420  : 17 'YU12'
    #
    v4l2_palette 7

    # Tuner device to be used for capturing using tuner as source (default /dev/tuner0)
    # This is ONLY used for FreeBSD. Leave it commented out for Linux
    ; tunerdevice /dev/tuner0

    # The video input to be used (default: -1)
    # Should normally be set to 0 or 1 for video/TV cards, and -1 for USB cameras
    input -1

    # The video norm to use (only for video capture and TV tuner cards)
    # Values: 0 (PAL), 1 (NTSC), 2 (SECAM), 3 (PAL NC no colour). Default: 0 (PAL)
    norm 0

    # The frequency to set the tuner to (kHz) (only for TV tuner cards) (default: 0)
    frequency 0

    # Rotate image this number of degrees. The rotation affects all saved images as
    # well as movies. Valid values: 0 (default = no rotation), 90, 180 and 270.
    rotate 0

    # Image width (pixels). Valid range: Camera dependent, default: 352
    #width 1024
    width 640

    # Image height (pixels). Valid range: Camera dependent, default: 288
    #height 576
    height 480

    # Maximum number of frames to be captured per second.
    # Valid range: 2-100. Default: 100 (almost no limit).
    framerate 15

    # Minimum time in seconds between capturing picture frames from the camera.
    # Default: 0 = disabled - the capture rate is given by the camera framerate.
    # This option is used when you want to capture images at a rate lower than 2 per second.
    minimum_frame_time 0

    # URL to use if you are using a network camera, size will be autodetected (incl http:// ftp:// mjpg:// or file:///)
    # Must be a URL that returns single jpeg pictures or a raw mjpeg stream. Default: Not defined
    ;netcam_url http://127.0.0.1/cgi-bin/raspicam.sh

    # Username and password for network camera (only if required). Default: not defined
    # Syntax is user:password
    ; netcam_userpass value

    # The setting for keep-alive of network socket, should improve performance on compatible net cameras.
    # off:   The historical implementation using HTTP/1.0, closing the socket after each http request.
    # force: Use HTTP/1.0 requests with keep alive header to reuse the same connection.
    # on:    Use HTTP/1.1 requests that support keep alive as default.
    # Default: off
    netcam_keepalive off

    # URL to use for a netcam proxy server, if required, e.g. "http://myproxy".
    # If a port number other than 80 is needed, use "http://myproxy:1234".
    # Default: not defined
    ; netcam_proxy value

    # Set less strict jpeg checks for network cameras with a poor/buggy firmware.
    # Default: off
    netcam_tolerant_check off

    # Let motion regulate the brightness of a video device (default: off).
    # The auto_brightness feature uses the brightness option as its target value.
    # If brightness is zero auto_brightness will adjust to average brightness value 128.
    # Only recommended for cameras without auto brightness
    auto_brightness off

    # Set the initial brightness of a video device.
    # If auto_brightness is enabled, this value defines the average brightness level
    # which Motion will try and adjust to.
    # Valid range 0-255, default 0 = disabled
    brightness 0

    # Set the contrast of a video device.
    # Valid range 0-255, default 0 = disabled
    contrast 0

    # Set the saturation of a video device.
    # Valid range 0-255, default 0 = disabled
    saturation 0

    # Set the hue of a video device (NTSC feature).
    # Valid range 0-255, default 0 = disabled
    hue 0

    ############################################################
    # File "camera" support - read raw YUV data from a file
    ############################################################
    #filecam_path /home/pi/test-cap/motion-mmal.capture

    ############################################################
    # OpenMax/MMAL camera support for Raspberry Pi
    ############################################################
    mmalcam_name vc.ril.camera
    #mmalcam_control_params
    #mmalcam_raw_capture_file /home/pi/motion-mmal.capture

    # Switch this setting to "on" to use the still image mode of the Pi's camera
    # instead of video. This gives a wider field of view, but requires
    # a much slower frame-rate to achieve exposure stability
    # (e.g. 0.25 fps or slower). You can use the minimum_frame_time
    # parameter above to achieve this

    mmalcam_use_still off


    ############################################################
    # Round Robin (multiple inputs on same video device name)
    ############################################################

    # Number of frames to capture in each roundrobin step (default: 1)
    roundrobin_frames 1

    # Number of frames to skip before each roundrobin step (default: 1)
    roundrobin_skip 1

    # Try to filter out noise generated by roundrobin (default: off)
    switchfilter off


    ############################################################
    # Motion Detection Settings:
    ############################################################

    # Threshold for number of changed pixels in an image that
    # triggers motion detection (default: 1500)
    threshold 1500

    # Automatically tune the threshold down if possible (default: off)
    threshold_tune off

    # Noise threshold for the motion detection (default: 32)
    noise_level 32

    # Automatically tune the noise threshold (default: on)
    noise_tune on

    # Despeckle motion image using (e)rode or (d)ilate or (l)abel (Default: not defined)
    # Recommended value is EedDl. Any combination (and number of) of E, e, d, and D is valid.
    # (l)abeling must only be used once and the 'l' must be the last letter.
    # Comment out to disable
    despeckle_filter EedDl

    # Detect motion in predefined areas (1 - 9). Areas are numbered like that:  1 2 3
    # A script (on_area_detected) is started immediately when motion is         4 5 6
    # detected in one of the given areas, but only once during an event.        7 8 9
    # One or more areas can be specified with this option. Take care: This option
    # does NOT restrict detection to these areas! (Default: not defined)
    ; area_detect value

    # PGM file to use as a sensitivity mask.
    # Full path name to. (Default: not defined)
    ; mask_file value

    # Dynamically create a mask file during operation (default: 0)
    # Adjust speed of mask changes from 0 (off) to 10 (fast)
    smart_mask_speed 0

    # Ignore sudden massive light intensity changes given as a percentage of the picture
    # area that changed intensity. Valid range: 0 - 100 , default: 0 = disabled
    lightswitch 0

    # Picture frames must contain motion at least the specified number of frames
    # in a row before they are detected as true motion. At the default of 1, all
    # motion is detected. Valid range: 1 to thousands, recommended 1-5
    minimum_motion_frames 1

    # Specifies the number of pre-captured (buffered) pictures from before motion
    # was detected that will be output at motion detection.
    # Recommended range: 0 to 5 (default: 0)
    # Do not use large values! Large values will cause Motion to skip video frames and
    # cause unsmooth movies. To smooth movies use larger values of post_capture instead.
    pre_capture 2

    # Number of frames to capture after motion is no longer detected (default: 0)
    post_capture 2

    # Event Gap is the seconds of no motion detection that triggers the end of an event.
    # An event is defined as a series of motion images taken within a short timeframe.
    # Recommended value is 60 seconds (Default). The value -1 is allowed and disables
    # events causing all Motion to be written to one single movie file and no pre_capture.
    # If set to 0, motion is running in gapless mode. Movies don't have gaps anymore. An
    # event ends right after no more motion is detected and post_capture is over.
    event_gap 60

    # Maximum length in seconds of an mpeg movie
    # When value is exceeded a new movie file is created. (Default: 0 = infinite)
    # ATTENTION: when you're not using the motion build from the tutorial, it might fail with error 'Unknown config option "max_mpeg_time"'
    # the use this line instead:
    # max_movie_time 60
    max_movie_time 60

    # Always save images even if there was no motion (default: off)
    emulate_motion off


    ############################################################
    # Image File Output
    ############################################################

    # Output 'normal' pictures when motion is detected (default: on)
    # Valid values: on, off, first, best, center
    # When set to 'first', only the first picture of an event is saved.
    # Picture with most motion of an event is saved when set to 'best'.
    # Picture with motion nearest center of picture is saved when set to 'center'.
    # Can be used as preview shot for the corresponding movie.
    output_pictures best

    # Output pictures with only the pixels moving object (ghost images) (default: off)
    output_debug_pictures off

    # The quality (in percent) to be used by the jpeg compression (default: 75)
    quality 75

    # Type of output images
    # Valid values: jpeg, ppm (default: jpeg)
    picture_type jpeg

    ############################################################
    # FFMPEG related options
    # Film (movies) file output, and deinterlacing of the video input
    # The options movie_filename and timelapse_filename are also used
    # by the ffmpeg feature
    ############################################################

    # Use ffmpeg to encode movies in realtime (default: off)
    ffmpeg_output_movies on

    # Use ffmpeg to make movies with only the pixels moving
    # object (ghost images) (default: off)
    ffmpeg_output_debug_movies off

    # Use ffmpeg to encode a timelapse movie
    # Default value 0 = off - else save frame every Nth second
    ffmpeg_timelapse 0

    # The file rollover mode of the timelapse video
    # Valid values: hourly, daily (default), weekly-sunday, weekly-monday, monthly, manual
    ffmpeg_timelapse_mode daily

    # Bitrate to be used by the ffmpeg encoder (default: 400000)
    # This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled)
    ffmpeg_bps 500000

    # Enables and defines variable bitrate for the ffmpeg encoder.
    # ffmpeg_bps is ignored if variable bitrate is enabled.
    # Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps,
    # or the range 2 - 31 where 2 means best quality and 31 is worst.
    ffmpeg_variable_bitrate 5

    # Codec to used by ffmpeg for the video compression.
    # Timelapse mpegs are always made in mpeg1 format independent from this option.
    # Supported formats are: mpeg1 (ffmpeg-0.4.8 only), mpeg4 (default), and msmpeg4.
    # mpeg1 - gives you files with extension .mpg
    # mpeg4 or msmpeg4 - gives you files with extension .avi
    # msmpeg4 is recommended for use with Windows Media Player because
    # it requires no installation of codec on the Windows client.
    # swf - gives you a flash film with extension .swf
    # flv - gives you a flash video with extension .flv
    # ffv1 - FF video codec 1 for Lossless Encoding ( experimental )
    # mov - QuickTime ( testing )
    # ogg - Ogg/Theora ( testing )
    #ffmpeg_video_codec msmpeg4
    ffmpeg_video_codec mp4

    # Use ffmpeg to deinterlace video. Necessary if you use an analog camera
    # and see horizontal combing on moving objects in video or pictures.
    # (default: off)
    ffmpeg_deinterlace off

    ############################################################
    # SDL Window
    ############################################################

    # Number of motion thread to show in SDL Window (default: 0 = disabled)
    #sdl_threadnr 0

    ############################################################
    # External pipe to video encoder
    # Replacement for FFMPEG builtin encoder for ffmpeg_output_movies only.
    # The options movie_filename and timelapse_filename are also used
    # by the ffmpeg feature
    #############################################################

    # Bool to enable or disable extpipe (default: off)
    use_extpipe off

    # External program (full path and opts) to pipe raw video to
    # Generally, use '-' for STDIN...
    ;extpipe mencoder -demuxer rawvideo -rawvideo w=320:h=240:i420 -ovc x264 -x264encopts bframes=4:frameref=1:subq=1:scenecut=-1:nob_adapt:threads=1:keyint=1000:8x8dct:vbv_bufsize=4000:crf=24:partitions=i8x8,i4x4:vbv_maxrate=800:no-chroma-me -vf denoise3d=16:12:48:4,pp=lb -of   avi -o %f.avi - -fps %fps



    ############################################################
    # Snapshots (Traditional Periodic Webcam File Output)
    ############################################################

    # Make automated snapshot every N seconds (default: 0 = disabled)
    snapshot_interval 0


    ############################################################
    # Text Display
    # %Y = year, %m = month, %d = date,
    # %H = hour, %M = minute, %S = second, %T = HH:MM:SS,
    # %v = event, %q = frame number, %t = thread (camera) number,
    # %D = changed pixels, %N = noise level, \n = new line,
    # %i and %J = width and height of motion area,
    # %K and %L = X and Y coordinates of motion center
    # %C = value defined by text_event - do not use with text_event!
    # You can put quotation marks around the text to allow
    # leading spaces
    ############################################################

    # Locate and draw a box around the moving object.
    # Valid values: on, off, preview (default: off)
    # Set to 'preview' will only draw a box in preview_shot pictures.
    locate_motion_mode off

    # Set the look and style of the locate box if enabled.
    # Valid values: box, redbox, cross, redcross (default: box)
    # Set to 'box' will draw the traditional box.
    # Set to 'redbox' will draw a red box.
    # Set to 'cross' will draw a little cross to mark center.
    # Set to 'redcross' will draw a little red cross to mark center.
    locate_motion_style box

    # Draws the timestamp using same options as C function strftime(3)
    # Default: %Y-%m-%d\n%T = date in ISO format and time in 24 hour clock
    # Text is placed in lower right corner
    text_right %d.%m.%Y\n%T

    # Draw a user defined text on the images using same options as C function strftime(3)
    # Default: Not defined = no text
    # Text is placed in lower left corner
    ; text_left CAMERA %t
    text_left HofCam

    # Draw the number of changed pixed on the images (default: off)
    # Will normally be set to off except when you setup and adjust the motion settings
    # Text is placed in upper right corner
    text_changes off

    # This option defines the value of the special event conversion specifier %C
    # You can use any conversion specifier in this option except %C. Date and time
    # values are from the timestamp of the first image in the current event.
    # Default: %Y%m%d%H%M%S
    # The idea is that %C can be used filenames and text_left/right for creating
    # a unique identifier for each event.
    text_event %Y%m%d%H%M%S

    # Draw characters at twice normal size on images. (default: off)
    text_double on


    # Text to include in a JPEG EXIF comment
    # May be any text, including conversion specifiers.
    # The EXIF timestamp is included independent of this text.
    ;exif_text %i%J/%K%L

    ############################################################
    # Target Directories and filenames For Images And Films
    # For the options snapshot_, picture_, movie_ and timelapse_filename
    # you can use conversion specifiers
    # %Y = year, %m = month, %d = date,
    # %H = hour, %M = minute, %S = second,
    # %v = event, %q = frame number, %t = thread (camera) number,
    # %D = changed pixels, %N = noise level,
    # %i and %J = width and height of motion area,
    # %K and %L = X and Y coordinates of motion center
    # %C = value defined by text_event
    # Quotation marks round string are allowed.
    ############################################################

    # Target base directory for pictures and films
    # Recommended to use absolute path. (Default: current working directory)
    target_dir /home/pi

    # File path for snapshots (jpeg or ppm) relative to target_dir
    # Default: %v-%Y%m%d%H%M%S-snapshot
    # Default value is equivalent to legacy oldlayout option
    # For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-snapshot
    # File extension .jpg or .ppm is automatically added so do not include this.
    # Note: A symbolic link called lastsnap.jpg created in the target_dir will always
    # point to the latest snapshot, unless snapshot_filename is exactly 'lastsnap'
    snapshot_filename %v-%Y%m%d%H%M%S-snapshot

    # File path for motion triggered images (jpeg or ppm) relative to target_dir
    # Default: %v-%Y%m%d%H%M%S-%q
    # Default value is equivalent to legacy oldlayout option
    # For Motion 3.0 compatible mode choose: %Y/%m/%d/%H/%M/%S-%q
    # File extension .jpg or .ppm is automatically added so do not include this
    # Set to 'preview' together with best-preview feature enables special naming
    # convention for preview shots. See motion guide for details
    picture_filename %v-%Y%m%d%H%M%S-%q

    # File path for motion triggered ffmpeg films (movies) relative to target_dir
    # Default: %v-%Y%m%d%H%M%S
    # Default value is equivalent to legacy oldlayout option
    # For Motion 3.0 compatible mode choose: %Y/%m/%d/%H%M%S
    # File extension .mpg or .avi is automatically added so do not include this
    # This option was previously called ffmpeg_filename
    movie_filename %v-%Y%m%d%H%M%S

    # File path for timelapse movies relative to target_dir
    # Default: %Y%m%d-timelapse
    # Default value is near equivalent to legacy oldlayout option
    # For Motion 3.0 compatible mode choose: %Y/%m/%d-timelapse
    # File extension .mpg is automatically added so do not include this
    timelapse_filename %Y%m%d-timelapse

    ############################################################
    # Global Network Options
    ############################################################
    # Enable or disable IPV6 for http control and stream (default: off )
    ipv6_enabled off

    ############################################################
    # Live Stream Server
    ############################################################

    # The mini-http server listens to this port for requests (default: 0 = disabled)
    stream_port 8080

    # Quality of the jpeg (in percent) images produced (default: 50)
    stream_quality 50

    # Output frames at 1 fps when no motion is detected and increase to the
    # rate given by stream_maxrate when motion is detected (default: off)
    stream_motion on

    # Maximum framerate for stream streams (default: 1)
    stream_maxrate 4

    # Restrict stream connections to localhost only (default: on)
    stream_localhost off

    # Limits the number of images per connection (default: 0 = unlimited)
    # Number can be defined by multiplying actual stream rate by desired number of seconds
    # Actual stream rate is the smallest of the numbers framerate and stream_maxrate
    stream_limit 0

    # Set the authentication method (default: 0)
    # 0 = disabled
    # 1 = Basic authentication
    # 2 = MD5 digest (the safer authentication)
    stream_auth_method 0

    # Authentication for the stream. Syntax username:password
    # Default: not defined (Disabled)
    ; stream_authentication username:password


    ############################################################
    # HTTP Based Control
    ############################################################

    # TCP/IP port for the http server to listen on (default: 0 = disabled)
    webcontrol_port 8081

    # Restrict control connections to localhost only (default: on)
    webcontrol_localhost off

    # Output for http server, select off to choose raw text plain (default: on)
    webcontrol_html_output on

    # Authentication for the http based control. Syntax username:password
    # Default: not defined (Disabled)
    ; webcontrol_authentication username:password


    ############################################################
    # Tracking (Pan/Tilt)
    #############################################################

    # Type of tracker (0=none (default), 1=stepper, 2=iomojo, 3=pwc, 4=generic, 5=uvcvideo, 6=servo)
    # The generic type enables the definition of motion center and motion size to
    # be used with the conversion specifiers for options like on_motion_detected
    track_type 0

    # Enable auto tracking (default: off)
    track_auto off

    # Serial port of motor (default: none)
    ;track_port /dev/ttyS0

    # Motor number for x-axis (default: 0)
    ;track_motorx 0

    # Set motorx reverse (default: 0)
    ;track_motorx_reverse 0

    # Motor number for y-axis (default: 0)
    ;track_motory 1

    # Set motory reverse (default: 0)
    ;track_motory_reverse 0

    # Maximum value on x-axis (default: 0)
    ;track_maxx 200

    # Minimum value on x-axis (default: 0)
    ;track_minx 50

    # Maximum value on y-axis (default: 0)
    ;track_maxy 200

    # Minimum value on y-axis (default: 0)
    ;track_miny 50

    # Center value on x-axis (default: 0)
    ;track_homex 128

    # Center value on y-axis (default: 0)
    ;track_homey 128

    # ID of an iomojo camera if used (default: 0)
    track_iomojo_id 0

    # Angle in degrees the camera moves per step on the X-axis
    # with auto-track (default: 10)
    # Currently only used with pwc type cameras
    track_step_angle_x 10

    [...]
  • recording from webcam using ffmpeg at high framerate

    14 novembre 2017, par Zorglub29

    I have a webcam (model Brio 4K stream edition from Logitech) that is able to record at resolution 1280x720 and 60 fps in guvcview on Ubuntu 16.04. I then use a video codec ’raw camera input’. This is working fine and as expected, and the result is well a 60 fps video at the desired resolution.

    However, I need to record using command line and not GUI. The guvcview GUI crashes on my machine (segmentation fault, this has been reported by other users before), so I want to use ffmpeg instead.

    Unfortunately, when I use the command (in terminal) :

    ffmpeg -i /dev/video1 -framerate 60 -video_size 1280x720 out.mkv

    I only get around 30 fps out. This is of course not due to the camera by itself (it works at 60 fps in guvcview), but I cannot understand why I get 30 fps when I ask for 60 fps explicitely. It also looks in the output of ffmpeg as it records at 30 fps :

    Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv422p, 1280x720, q=-1--1, 30 fps, 1k tbn, 30 tbc

    Any suggestion how I can solve this and record at 60 fps using ffmpeg ?

    Note : I also tried something like this, with the same result (only 30 fps) :

    ffmpeg -f video4linux2 -i /dev/video1 -framerate 60.0 -video_size 1280x720 out.mkv

    Edit 1 thank you for the help in comment : order of arguments matters. Now using :

    ffmpeg -framerate 60 -video_size 1280x720 -i /dev/video1 out.mkv

    I get still around 30 fps, and a new (probably more understandable) warning message :

    [video4linux2,v4l2 @ 0x1ddc4e0] The driver changed the time per frame from 1/60 to 1/30
    Input #0, video4linux2,v4l2, from '/dev/video1':
     Duration: N/A, start: 256338.694616, bitrate: 442368 kb/s
       Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc

    I find several entries for this problem (video4linux2 + The driver changed the time per frame), but no clear solution.

    Edit 2 + 3 :

    v4l2-ctl -d 1 --list-formats-ext
    ioctl: VIDIOC_ENUM_FMT
       Index       : 0
       Type        : Video Capture
       Pixel Format: 'YUYV'
       Name        : YUYV 4:2:2
           Size: Discrete 640x480
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 160x120
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 176x144
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 320x180
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 320x240
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 352x288
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 340x340
               Interval: Discrete 0.033s (30.000 fps)
           Size: Discrete 424x240
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 440x440
               Interval: Discrete 0.033s (30.000 fps)
           Size: Discrete 480x270
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 640x360
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 800x448
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 800x600
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 848x480
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 960x540
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1024x576
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1280x720
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1600x896
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1920x1080
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)

       Index       : 1
       Type        : Video Capture
       Pixel Format: 'MJPG' (compressed)
       Name        : Motion-JPEG
           Size: Discrete 640x480
               Interval: Discrete 0.008s (120.000 fps)
               Interval: Discrete 0.011s (90.000 fps)
               Interval: Discrete 0.017s (60.000 fps)
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 160x120
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 176x144
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 320x180
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 320x240
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 352x288
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 424x240
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 480x270
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 640x360
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 800x448
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 800x600
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 848x480
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 960x540
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1024x576
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1280x720
               Interval: Discrete 0.011s (90.000 fps)
               Interval: Discrete 0.017s (60.000 fps)
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1600x896
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1920x1080
               Interval: Discrete 0.017s (60.000 fps)
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 2560x1440
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 3840x2160
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 4096x2160
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)

       Index       : 2
       Type        : Video Capture
       Pixel Format: 'NV12'
       Name        : Y/CbCr 4:2:0
           Size: Discrete 640x480
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 640x360
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1280x720
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)
           Size: Discrete 1920x1080
               Interval: Discrete 0.033s (30.000 fps)
               Interval: Discrete 0.042s (24.000 fps)
               Interval: Discrete 0.050s (20.000 fps)
               Interval: Discrete 0.067s (15.000 fps)
               Interval: Discrete 0.100s (10.000 fps)
               Interval: Discrete 0.133s (7.500 fps)
               Interval: Discrete 0.200s (5.000 fps)

    Edit 4 :

    It looks like there may still be a problem using :

    ffmpeg -f v4l2 -framerate 60 -video_size 1280x720 -input_format mjpeg -i /dev/video1 out.mkv

    As the output of ffmpeg looks like :

    Output #0, matroska, to 'out.mkv':
     Metadata:
     encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuvj422p(pc), 1280x720, q=-1--1, 60 fps, 1k tbn, 60 tbc
     Metadata:
     encoder         : Lavc56.60.100 libx264
    Stream mapping:
    Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    frame=  198 fps= 37 q=-1.0 Lsize=    1043kB time=00:00:05.38 bitrate=1587.4kbits/s

    Is the fps indicated in the last line (37 instead of 60) reliable ? It was working at 60 fps with guvcview, so I do not think the laptop write speeed or CPU is the problem.

    Edit 5 :

    Thank you for the great help @LordNeckbeard , now it looks like everything works using your additional output argument command ffmpeg -f v4l2 -framerate 60 -video_size 1280x720 -input_format mjpeg -i /dev/video1 -preset faster -pix_fmt yuv420p out.mkv :

    $ ffmpeg -f v4l2 -framerate 60 -video_size 1280x720 -input_format mjpeg -i /dev/video1 -preset faster -pix_fmt yuv420p out.mkv
    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
     configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
     libavutil      54. 31.100 / 54. 31.100
     libavcodec     56. 60.100 / 56. 60.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 40.101 /  5. 40.101
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    [mjpeg @ 0x1d6f320] Changeing bps to 8
    Input #0, video4linux2,v4l2, from '/dev/video1':
     Duration: N/A, start: 259410.922692, bitrate: N/A
       Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, -10 kb/s, 60 fps, 60 tbr, 1000k tbn, 1000k tbc
    [swscaler @ 0x1d7e480] deprecated pixel format used, make sure you did set range correctly
    [libx264 @ 0x1d72620] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x1d72620] profile High, level 3.2
    [libx264 @ 0x1d72620] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=4 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=20 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, matroska, to 'out.mkv':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 1280x720, q=-1--1, 60 fps, 1k tbn, 60 tbc
       Metadata:
         encoder         : Lavc56.60.100 libx264
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    frame=  467 fps= 59 q=-1.0 Lsize=     914kB time=00:00:07.83 bitrate= 955.8kbits/s    
    video:910kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.434447%
    [libx264 @ 0x1d72620] frame I:2     Avg QP:21.96  size: 61186
    [libx264 @ 0x1d72620] frame P:118   Avg QP:26.01  size:  4695
    [libx264 @ 0x1d72620] frame B:347   Avg QP:27.54  size:   734
    [libx264 @ 0x1d72620] consecutive B-frames:  0.4%  1.3%  0.6% 97.6%
    [libx264 @ 0x1d72620] mb I  I16..4: 14.7% 45.2% 40.0%
    [libx264 @ 0x1d72620] mb P  I16..4:  1.4%  3.7%  0.0%  P16..4: 29.9%  4.1%  0.5%  0.0%  0.0%    skip:60.4%
    [libx264 @ 0x1d72620] mb B  I16..4:  0.2%  0.4%  0.0%  B16..8:  5.4%  0.2%  0.0%  direct: 4.3%  skip:89.6%  L0:53.4% L1:42.7% BI: 3.9%
    [libx264 @ 0x1d72620] 8x8 transform intra:66.4% inter:71.8%
    [libx264 @ 0x1d72620] coded y,uvDC,uvAC intra: 38.1% 50.7% 12.7% inter: 2.8% 7.6% 0.1%
    [libx264 @ 0x1d72620] i16 v,h,dc,p: 36% 36% 16% 11%
    [libx264 @ 0x1d72620] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 32% 37%  2%  2%  2%  4%  1%  5%
    [libx264 @ 0x1d72620] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 46%  8%  2%  3%  3%  4%  3% 12%
    [libx264 @ 0x1d72620] i8c dc,h,v,p: 56% 26% 16%  3%
    [libx264 @ 0x1d72620] Weighted P-Frames: Y:9.3% UV:7.6%
    [libx264 @ 0x1d72620] ref P L0: 58.6% 41.4%
    [libx264 @ 0x1d72620] ref B L0: 56.9% 43.1%
    [libx264 @ 0x1d72620] ref B L1: 85.5% 14.5%
    [libx264 @ 0x1d72620] kb/s:946.85