Recherche avancée

Médias (91)

Autres articles (79)

  • 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 (...)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (10005)

  • FFmpeg : unspecified pixel format when opening video with custom context

    14 février 2021, par Pedro

    I am trying to decode a video with a custom context. The purpose is that I want to decode the video directly from memory. In the following code, I am reading from file in the read function passed to avio_alloc_context - but this is just for testing purposes.

    



    I think I've read any post there is on Stackoverflow or on any other website related to this topic. At least I definitely tried my best to do so. While there is much in common, the details differ : people set different flags, some say av_probe_input_format is required, some say it isn't, etc. And for some reason nothing works for me.

    



    My problem is that the pixel format is unspecified (see output below), which is why I run into problems later when calling sws_getContext. I checked pFormatContext->streams[videoStreamIndex]->codec->pix_fmt, and it is -1.

    



    Please note my comments // things I tried and // seems not to help in the code. I think, the answer might be hidden somehwere there. I tried many combinations of hints that I've read so far, but I am missing a detail I guess.

    



    The problem is not the video file, because when I go the standard way and just call avformat_open_input(&pFormatContext, pFilePath, NULL, NULL) without a custom context, everything runs fine.

    



    The code compiles and runs as is.

    



    #include <libavformat></libavformat>avformat.h>&#xA;#include &#xA;#include &#xA;&#xA;FILE *f;&#xA;&#xA;static int read(void *opaque, uint8_t *buf, int buf_size) {&#xA;    if (feof(f)) return -1;&#xA;    return fread(buf, 1, buf_size, f);&#xA;}&#xA;&#xA;int openVideo(const char *pFilePath) {&#xA;    const int bufferSize = 32768;&#xA;    int ret;&#xA;&#xA;    av_register_all();&#xA;&#xA;    f = fopen(pFilePath, "rb");&#xA;    uint8_t *pBuffer = (uint8_t *) av_malloc(bufferSize &#x2B; AVPROBE_PADDING_SIZE);&#xA;    AVIOContext *pAVIOContext = avio_alloc_context(pBuffer, bufferSize, 0, NULL,&#xA;                      &amp;read, NULL, NULL);&#xA;&#xA;    if (!f || !pBuffer || !pAVIOContext) {&#xA;        printf("error: open / alloc failed\n");&#xA;        // cleanup...&#xA;        return 1;&#xA;    }&#xA;&#xA;    AVFormatContext *pFormatContext = avformat_alloc_context();&#xA;    pFormatContext->pb = pAVIOContext;&#xA;&#xA;    const int readBytes = read(NULL, pBuffer, bufferSize);&#xA;&#xA;    printf("readBytes = %i\n", readBytes);&#xA;&#xA;    if (readBytes &lt;= 0) {&#xA;        printf("error: read failed\n");&#xA;        // cleanup...&#xA;        return 2;&#xA;    }&#xA;&#xA;    if (fseek(f, 0, SEEK_SET) != 0) {&#xA;        printf("error: fseek failed\n");&#xA;        // cleanup...&#xA;        return 3;&#xA;    }&#xA;&#xA;    // required for av_probe_input_format&#xA;    memset(pBuffer &#x2B; readBytes, 0, AVPROBE_PADDING_SIZE);&#xA;&#xA;    AVProbeData probeData;&#xA;    probeData.buf = pBuffer;&#xA;    probeData.buf_size = readBytes;&#xA;    probeData.filename = "";&#xA;    probeData.mime_type = NULL;&#xA;&#xA;    pFormatContext->iformat = av_probe_input_format(&amp;probeData, 1);&#xA;&#xA;    // things I tried:&#xA;    //pFormatContext->flags = AVFMT_FLAG_CUSTOM_IO;&#xA;    //pFormatContext->iformat->flags |= AVFMT_NOFILE;&#xA;    //pFormatContext->iformat->read_header = NULL;&#xA;&#xA;    // seems not to help (therefore commented out here):&#xA;    AVDictionary *pDictionary = NULL;&#xA;    //av_dict_set(&amp;pDictionary, "analyzeduration", "8000000", 0);&#xA;    //av_dict_set(&amp;pDictionary, "probesize", "8000000", 0);&#xA;&#xA;    if ((ret = avformat_open_input(&amp;pFormatContext, "", NULL, &amp;pDictionary)) &lt; 0) {&#xA;        char buffer[4096];&#xA;        av_strerror(ret, buffer, sizeof(buffer));&#xA;        printf("error: avformat_open_input failed: %s\n", buffer);&#xA;        // cleanup...&#xA;        return 4;&#xA;    }&#xA;&#xA;    printf("retrieving stream information...\n");&#xA;&#xA;    if ((ret = avformat_find_stream_info(pFormatContext, NULL)) &lt; 0) {&#xA;        char buffer[4096];&#xA;        av_strerror(ret, buffer, sizeof(buffer));&#xA;        printf("error: avformat_find_stream_info failed: %s\n", buffer);&#xA;        // cleanup...&#xA;        return 5;&#xA;    }&#xA;&#xA;    printf("nb_streams = %i\n", pFormatContext->nb_streams);&#xA;&#xA;    // further code...&#xA;&#xA;    // cleanup...&#xA;    return 0;&#xA;}&#xA;&#xA;int main() {&#xA;    openVideo("video.mp4");&#xA;    return 0;&#xA;}&#xA;

    &#xA;&#xA;

    This is the output that I get :
    &#xA;readBytes = 32768
    &#xA;retrieving stream information...
    &#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0xdf8d20] stream 0, offset 0x30 : partial file&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0xdf8d20] Could not find codec parameters for stream 0 (Video : h264 (avc1 / 0x31637661), none, 640x360, 351 kb/s) : unspecified pixel format
    &#xA;Consider increasing the value for the 'analyzeduration' and 'probesize' options
    &#xA;nb_streams = 2

    &#xA;&#xA;

    UPDATE :
    &#xA;Thanks to WLGfx, here is the solution : The only thing that was missing was the seek function. Apparently, implementing it is mandatory for decoding. It is important to return the new offset - and not 0 in case of success (some solutions found in the web just return the return value of fseek, and that is wrong). Here is the minimal solution that made it work :

    &#xA;&#xA;

    static int64_t seek(void *opaque, int64_t offset, int whence) {&#xA;    if (whence == SEEK_SET &amp;&amp; fseek(f, offset, SEEK_SET) == 0) {&#xA;        return offset;&#xA;    }&#xA;    // handling AVSEEK_SIZE doesn&#x27;t seem mandatory&#xA;    return -1;&#xA;}&#xA;

    &#xA;&#xA;

    Of course, the call to avio_alloc_context needs to be adapted accordingly :

    &#xA;&#xA;

    AVIOContext *pAVIOContext = avio_alloc_context(pBuffer, bufferSize, 0, NULL,&#xA;                      &amp;read, NULL, &amp;seek);&#xA;

    &#xA;

  • Rust Win32 FFI : User-mode data execution prevention (DEP) violation

    28 avril 2022, par TheElix

    I'm trying to pass a ID3D11Device instance from Rust to a C FFI Library (FFMPEG).

    &#xA;

    I made this sample code :

    &#xA;

    pub fn create_d3d11_device(&amp;mut self, device: &amp;mut Box, context: &amp;mut Box) {&#xA;            let av_device : Box<avbufferref> = self.alloc(HwDeviceType::D3d11va);&#xA;            unsafe {&#xA;                let device_context = Box::from_raw(av_device.data as *mut AVHWDeviceContext);&#xA;                let mut d3d11_device_context = Box::from_raw(device_context.hwctx as *mut AVD3D11VADeviceContext);&#xA;                d3d11_device_context.device = device.as_mut() as *mut _;&#xA;                d3d11_device_context.device_context = context.as_mut() as *mut _;&#xA;                let avp = Box::into_raw(av_device);&#xA;                av_hwdevice_ctx_init(avp);&#xA;                self.av_hwdevice = Some(Box::from_raw(avp));&#xA;            }&#xA;        }&#xA;</avbufferref>

    &#xA;

    On the Rust side the Device does work, but on the C side, when FFMEPG calls ID3D11DeviceContext_QueryInterface the app crashes with the following error : Exception 0xc0000005 encountered at address 0x7ff9fb99ad38: User-mode data execution prevention (DEP) violation at location 0x7ff9fb99ad38

    &#xA;

    The address is actually the pointer for the lpVtbl of QueryInterface, like seen here :

    &#xA;

    The disassembly of the address also looks correct (this is done on an another debugging session) :

    &#xA;

    (lldb) disassemble --start-address 0x00007ffffdf3ad38&#xA;    0x7ffffdf3ad38: addb   %ah, 0x7ffffd(%rdi,%riz,8)&#xA;    0x7ffffdf3ad3f: addb   %al, (%rax)&#xA;    0x7ffffdf3ad41: movabsl -0x591fffff80000219, %eax&#xA;    0x7ffffdf3ad4a: outl   %eax, $0xfd&#xA;

    &#xA;

    Do you have any pointer to debug this further ?

    &#xA;

    EDIT : I made a Minimal Reproducion Sample. Interestingly this does not causes a DEP Violation, but simply a Segfault.

    &#xA;

    On the C side :

    &#xA;

    int test_ffi(ID3D11Device *device){&#xA;    ID3D11DeviceContext *context;&#xA;    device->lpVtbl->GetImmediateContext(device, &amp;context);&#xA;    if (!context) return 1;&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    On the Rust side :

    &#xA;

    unsafe fn main_rust(){&#xA;    let mut device = None;&#xA;    let mut device_context = None;&#xA;    let _ = match windows::Win32::Graphics::Direct3D11::D3D11CreateDevice(None, D3D_DRIVER_TYPE_HARDWARE, OtherHinstance::default(), D3D11_CREATE_DEVICE_DEBUG, &amp;[], D3D11_SDK_VERSION, &amp;mut device, std::ptr::null_mut(), &amp;mut device_context) {&#xA;        Ok(e) => e,&#xA;        Err(e) => panic!("Creation Failed: {}", e)&#xA;    };&#xA;    let mut device = match device {&#xA;        Some(e) => e,&#xA;        None => panic!("Creation Failed2")&#xA;    };&#xA;    let mut f2 : ID3D11Device = transmute_copy(&amp;device); //Transmuting the WinAPI into a bindgen ID3D11Device&#xA;    test_ffi(&amp;mut f2);&#xA;}&#xA;

    &#xA;

    The bindgen build.rs :

    &#xA;

    extern crate bindgen;&#xA;&#xA;use std::env;&#xA;use std::path::PathBuf;&#xA;&#xA;fn main() {&#xA;    // Tell cargo to tell rustc to link the system bzip2&#xA;    // shared library.&#xA;    println!("cargo:rustc-link-lib=ffi_demoLIB");&#xA;    println!("cargo:rustc-link-lib=d3d11");&#xA;&#xA;    // Tell cargo to invalidate the built crate whenever the wrapper changes&#xA;    println!("cargo:rerun-if-changed=library.h");&#xA;&#xA;    // The bindgen::Builder is the main entry point&#xA;    // to bindgen, and lets you build up options for&#xA;    // the resulting bindings.&#xA;    let bindings = bindgen::Builder::default()&#xA;        // The input header we would like to generate&#xA;        // bindings for.&#xA;        .header("library.h")&#xA;        // Tell cargo to invalidate the built crate whenever any of the&#xA;        // included header files changed.&#xA;        .parse_callbacks(Box::new(bindgen::CargoCallbacks))&#xA;        .blacklist_type("_IMAGE_TLS_DIRECTORY64")&#xA;        .blacklist_type("IMAGE_TLS_DIRECTORY64")&#xA;        .blacklist_type("PIMAGE_TLS_DIRECTORY64")&#xA;        .blacklist_type("IMAGE_TLS_DIRECTORY")&#xA;        .blacklist_type("PIMAGE_TLS_DIRECTORY")&#xA;        // Finish the builder and generate the bindings.&#xA;        .generate()&#xA;        // Unwrap the Result and panic on failure.&#xA;        .expect("Unable to generate bindings");&#xA;&#xA;    // Write the bindings to the $OUT_DIR/bindings.rs file.&#xA;    let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());&#xA;    bindings&#xA;        .write_to_file(out_path.join("bindings.rs"))&#xA;        .expect("Couldn&#x27;t write bindings!");&#xA;}&#xA;

    &#xA;

    The Complete Repo can be found over here : https://github.com/TheElixZammuto/demo-ffi

    &#xA;

  • Frames took with ELP camera has unknown pixel format at FHD ?

    11 novembre 2024, par Marcel Kopera

    I'm trying to take a one frame ever x seconds from my usb camera. Name of the camera is : ELP-USBFHD06H-SFV(5-50).&#xA;Code is not 100% done yet, but I'm using it this way right now ↓ (shot fn is called from main.py in a loop)

    &#xA;

    &#xA;import cv2&#xA;import subprocess&#xA;&#xA;from time import sleep&#xA;from collections import namedtuple&#xA;&#xA;from errors import *&#xA;&#xA;class Camera:&#xA;    def __init__(self, cam_index, res_width, res_height, pic_format, day_time_exposure_ms, night_time_exposure_ms):&#xA;        Resolution = namedtuple("resolution", ["width", "height"])&#xA;        self.manual_mode(True)&#xA;&#xA;        self.cam_index = cam_index&#xA;        self.camera_resolution = Resolution(res_width, res_height)&#xA;        self.picture_format = pic_format&#xA;        self.day_time_exposure_ms = day_time_exposure_ms&#xA;        self.night_time_exposure_ms = night_time_exposure_ms&#xA;&#xA;        self.started: bool = False&#xA;        self.night_mode = False&#xA;&#xA;        self.cap = cv2.VideoCapture(self.cam_index, cv2.CAP_V4L2)&#xA;        self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, self.camera_resolution.width)&#xA;        self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, self.camera_resolution.height)&#xA;        self.cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*self.picture_format))&#xA;&#xA;    &#xA;&#xA;    def start(self):&#xA;        sleep(1)&#xA;        if not self.cap.isOpened():&#xA;            return CameraCupError()&#xA;&#xA;        self.set_exposure_time(self.day_time_exposure_ms)&#xA;        self.set_brightness(0)&#xA;        sleep(0.1)&#xA;        &#xA;        self.started = True&#xA;&#xA;&#xA;&#xA;    def shot(self, picture_name, is_night):&#xA;        if not self.started:&#xA;            return InitializationError()&#xA;&#xA;        self.configure_mode(is_night)&#xA;&#xA;        # Clear buffer&#xA;        for _ in range(5):&#xA;            ret, _ = self.cap.read()&#xA;&#xA;        ret, frame = self.cap.read()&#xA;&#xA;        sleep(0.1)&#xA;&#xA;        if ret:&#xA;            print(picture_name)&#xA;            cv2.imwrite(picture_name, frame)&#xA;            return True&#xA;&#xA;        else:&#xA;            print("No photo")&#xA;            return False&#xA;&#xA;&#xA;    &#xA;    def release(self):&#xA;        self.set_exposure_time(156)&#xA;        self.set_brightness(0)&#xA;        self.manual_mode(False)&#xA;        self.cap.release()&#xA;&#xA;&#xA;&#xA;    def manual_mode(self, switch: bool):&#xA;        if switch:&#xA;            subprocess.run(["v4l2-ctl", "--set-ctrl=auto_exposure=1"])&#xA;        else:&#xA;            subprocess.run(["v4l2-ctl", "--set-ctrl=auto_exposure=3"])&#xA;        sleep(1)&#xA;&#xA;    &#xA;    &#xA;    def configure_mode(self, is_night):&#xA;        if is_night == self.night_mode:&#xA;            return&#xA;&#xA;        if is_night:&#xA;            self.night_mode = is_night&#xA;            self.set_exposure_time(self.night_time_exposure_ms)&#xA;            self.set_brightness(64)&#xA;        else:&#xA;            self.night_mode = is_night&#xA;            self.set_exposure_time(self.day_time_exposure_ms)&#xA;            self.set_brightness(0)&#xA;        sleep(0.1)&#xA;&#xA;&#xA;&#xA;    def set_exposure_time(self, ms: int):&#xA;        ms = int(ms)&#xA;        default_val = 156&#xA;&#xA;        if ms &lt; 1 or ms > 5000:&#xA;            ms = default_val&#xA;&#xA;        self.cap.set(cv2.CAP_PROP_EXPOSURE, ms)&#xA;&#xA;&#xA;&#xA;    def set_brightness(self, value: int):&#xA;        value = int(value)&#xA;        default_val = 0&#xA;&#xA;        if value &lt; -64 or value > 64:&#xA;            value = default_val&#xA;&#xA;        self.cap.set(cv2.CAP_PROP_BRIGHTNESS, value)&#xA;

    &#xA;

    Here are settings for the camera (yaml file)

    &#xA;

    camera:&#xA;  camera_index: 0&#xA;  res_width: 1920&#xA;  res_height: 1080&#xA;  picture_format: "MJPG"&#xA;  day_time_exposure_ms: 5&#xA;  night_time_exposure_ms: 5000&#xA;  photos_format: "jpg"&#xA;&#xA;

    &#xA;

    I do some configs like set manual mode for the camera, change exposure/brightness and saving frame.&#xA;Also the camera is probably catching the frames to the buffer (it is not saving latest frame in real time : it's more laggish), so I have to clear buffer every time. like this

    &#xA;

            # Clear buffer from old frames&#xA;        for _ in range(5):&#xA;            ret, _ = self.cap.read()&#xA;        &#xA;        # Get a new frame&#xA;        ret, frame = self.cap.read()&#xA;

    &#xA;

    What I really don't like, but I could find a better way (tldr : setting buffer for 1 frame doesn't work on my camera).

    &#xA;

    Frames saved this method looks good with 1920x1080 resolution. BUT when I try to run ffmpeg command to make a timelapse from saved jpg file like this

    &#xA;

    ffmpeg -framerate 20 -pattern_type glob -i "*.jpg" -c:v libx264 output.mp4&#xA;

    &#xA;

    I got an error like this one

    &#xA;

    [image2 @ 0x555609c45240] Could not open file : 08:59:20.jpg&#xA;[image2 @ 0x555609c45240] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size&#xA;Consider increasing the value for the &#x27;analyzeduration&#x27; (0) and &#x27;probesize&#x27; (5000000) options&#xA;Input #0, image2, from &#x27;*.jpg&#x27;:&#xA;  Duration: 00:00:00.05, start: 0.000000, bitrate: N/A&#xA;  Stream #0:0: Video: mjpeg, none(bt470bg/unknown/unknown), 20 fps, 20 tbr, 20 tbn&#xA;Output #0, mp4, to &#x27;output.mp4&#x27;:&#xA;Output file #0 does not contain any stream&#xA;

    &#xA;

    Also when I try to copy the files from Linux to Windows I get some weird copy failing error and option to skip the picture. But even when I press the skip button, the picture is copied and can be opened. I'm not sure what is wrong with the format, but the camera is supporting MPEG at 1920x1080.

    &#xA;

    >>> v4l2-ctl --all&#xA;&#xA;Driver Info:&#xA;        Driver name      : uvcvideo&#xA;        Card type        : H264 USB Camera: USB Camera&#xA;        Bus info         : usb-xhci-hcd.1-1&#xA;        Driver version   : 6.6.51&#xA;        Capabilities     : 0x84a00001&#xA;                Video Capture&#xA;                Metadata Capture&#xA;                Streaming&#xA;                Extended Pix Format&#xA;                Device Capabilities&#xA;        Device Caps      : 0x04200001&#xA;                Video Capture&#xA;                Streaming&#xA;                Extended Pix Format&#xA;Media Driver Info:&#xA;        Driver name      : uvcvideo&#xA;        Model            : H264 USB Camera: USB Camera&#xA;        Serial           : 2020032801&#xA;        Bus info         : usb-xhci-hcd.1-1&#xA;        Media version    : 6.6.51&#xA;        Hardware revision: 0x00000100 (256)&#xA;        Driver version   : 6.6.51&#xA;Interface Info:&#xA;        ID               : 0x03000002&#xA;        Type             : V4L Video&#xA;Entity Info:&#xA;        ID               : 0x00000001 (1)&#xA;        Name             : H264 USB Camera: USB Camera&#xA;        Function         : V4L2 I/O&#xA;        Flags            : default&#xA;        Pad 0x0100000d   : 0: Sink&#xA;          Link 0x0200001a: from remote pad 0x1000010 of entity &#x27;Extension 4&#x27; (Video Pixel Formatter): Data, Enabled, Immutable&#xA;Priority: 2&#xA;Video input : 0 (Camera 1: ok)&#xA;Format Video Capture:&#xA;        Width/Height      : 1920/1080&#xA;        Pixel Format      : &#x27;MJPG&#x27; (Motion-JPEG)&#xA;        Field             : None&#xA;        Bytes per Line    : 0&#xA;        Size Image        : 4147789&#xA;        Colorspace        : sRGB&#xA;        Transfer Function : Default (maps to sRGB)&#xA;        YCbCr/HSV Encoding: Default (maps to ITU-R 601)&#xA;        Quantization      : Default (maps to Full Range)&#xA;        Flags             :&#xA;Crop Capability Video Capture:&#xA;        Bounds      : Left 0, Top 0, Width 1920, Height 1080&#xA;        Default     : Left 0, Top 0, Width 1920, Height 1080&#xA;        Pixel Aspect: 1/1&#xA;Selection Video Capture: crop_default, Left 0, Top 0, Width 1920, Height 1080, Flags:&#xA;Selection Video Capture: crop_bounds, Left 0, Top 0, Width 1920, Height 1080, Flags:&#xA;Streaming Parameters Video Capture:&#xA;        Capabilities     : timeperframe&#xA;        Frames per second: 15.000 (15/1)&#xA;        Read buffers     : 0&#xA;&#xA;User Controls&#xA;&#xA;                     brightness 0x00980900 (int)    : min=-64 max=64 step=1 default=0 value=64&#xA;                       contrast 0x00980901 (int)    : min=0 max=64 step=1 default=32 value=32&#xA;                     saturation 0x00980902 (int)    : min=0 max=128 step=1 default=56 value=56&#xA;                            hue 0x00980903 (int)    : min=-40 max=40 step=1 default=0 value=0&#xA;        white_balance_automatic 0x0098090c (bool)   : default=1 value=1&#xA;                          gamma 0x00980910 (int)    : min=72 max=500 step=1 default=100 value=100&#xA;                           gain 0x00980913 (int)    : min=0 max=100 step=1 default=0 value=0&#xA;           power_line_frequency 0x00980918 (menu)   : min=0 max=2 default=1 value=1 (50 Hz)&#xA;                                0: Disabled&#xA;                                1: 50 Hz&#xA;                                2: 60 Hz&#xA;      white_balance_temperature 0x0098091a (int)    : min=2800 max=6500 step=1 default=4600 value=4600 flags=inactive&#xA;                      sharpness 0x0098091b (int)    : min=0 max=6 step=1 default=3 value=3&#xA;         backlight_compensation 0x0098091c (int)    : min=0 max=2 step=1 default=1 value=1&#xA;&#xA;Camera Controls&#xA;&#xA;                  auto_exposure 0x009a0901 (menu)   : min=0 max=3 default=3 value=1 (Manual Mode)&#xA;                                1: Manual Mode&#xA;                                3: Aperture Priority Mode&#xA;         exposure_time_absolute 0x009a0902 (int)    : min=1 max=5000 step=1 default=156 value=5000&#xA;     exposure_dynamic_framerate 0x009a0903 (bool)   : default=0 value=0&#xA;

    &#xA;

    I also tried to save the picture using ffmpeg in a case something is not right with opencv like this :

    &#xA;

    ffmpeg -f v4l2 -framerate 30 -video_size 1920x1080 -i /dev/video0 -c:v libx264 -preset fast -crf 23 -t 00:01:00 output.mp4&#xA;&#xA;

    &#xA;

    It is saving the picture but also changing its format

    &#xA;

    [video4linux2,v4l2 @ 0x555659ed92b0] The V4L2 driver changed the video from 1920x1080 to 800x600&#xA;[video4linux2,v4l2 @ 0x555659ed92b0] The driver changed the time per frame from 1/30 to 1/15&#xA;

    &#xA;

    But the format looks right when set it back to FHD using v4l2

    &#xA;

    &#xA;>>> v4l2-ctl --device=/dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=MJPG&#xA;>>> v4l2-ctl --get-fmt-video&#xA;&#xA;Format Video Capture:&#xA;        Width/Height      : 1920/1080&#xA;        Pixel Format      : &#x27;MJPG&#x27; (Motion-JPEG)&#xA;        Field             : None&#xA;        Bytes per Line    : 0&#xA;        Size Image        : 4147789&#xA;        Colorspace        : sRGB&#xA;        Transfer Function : Default (maps to sRGB)&#xA;        YCbCr/HSV Encoding: Default (maps to ITU-R 601)&#xA;        Quantization      : Default (maps to Full Range)&#xA;        Flags             :&#xA;

    &#xA;

    I'm not sure what could be wrong with the format/camera and I don't think I have enough information to figure it out.

    &#xA;

    I tried to use ffmpeg instead of opencv and also change a few settings in opencv&#x27;s cup config.

    &#xA;