How to use MJPEG mode

情報 フォーラム UVCCamera How to use MJPEG mode

このトピックには0件の返信が含まれ、1人の参加者がいます。3 年前 saki さんが最後の更新を行いました。

1件の投稿を表示中 - 1 - 1件目 (全1件中)
  • 投稿者
    投稿
  • #2471

    saki
    キーマスター

    Warning: Cannot modify header information - headers already sent by (output started at /export/sd207/www/jp/r/e/gmoserver/1/9/sd0342119/serenegiant.com/blog/wordpress-3.4.2-ja-jetpack-undernavicontrol/wp-content/themes/serenegiant/header.php:1) in /export/sd207/www/jp/r/e/gmoserver/1/9/sd0342119/serenegiant.com/blog/wordpress-3.4.2-ja-jetpack-undernavicontrol/wp-content/plugins/crayon-syntax-highlighter/crayon_wp.class.php on line 220

    If you want to use MJPEG mode, please change as follows,

    1) in UVCPreview::UVCPreview function (this is just safety)
    from
    frameBytes(DEFAULT_PREVIEW_WIDTH * DEFAULT_PREVIEW_HEIGHT * 2)
    to
    frameBytes(DEFAULT_PREVIEW_WIDTH * DEFAULT_PREVIEW_HEIGHT * 4)

    2) in UVCPreview::prepare_preview function
    from
    result = uvc_get_stream_ctrl_format_size_fps(mDeviceHandle, ctrl,
    UVC_FRAME_FORMAT_YUYV,
    requestWidth, requestHeight, 1, 30 );
    to
    result = uvc_get_stream_ctrl_format_size_fps(mDeviceHandle, ctrl,
    UVC_FRAME_FORMAT_MJPEG,
    requestWidth, 1, 30 );

    3) in UVCPreview::do_preview function,
    from
    while (LIKELY(isRunning())) {
    frame = waitPreviewFrame();
    if (LIKELY(frame)) {
    frame = draw_preview_one(frame, &mPreviewWindow, uvc_any2rgbx, 4);
    addCaptureFrame(frame);
    }
    }
    to
    while (LIKELY(isRunning())) {
    frame_mjpeg = waitPreviewFrame();
    if (LIKELY(frame_mjpeg)) {
    frame_yuyv = uvc_allocate_frame(frame_mjpeg->width * frame_mjpeg->height * 2);
    result = uvc_mjpeg2yuyv(frame_mjpeg, frame_yuyv); // MJPEG => yuyv
    uvc_free_frame(frame_mjpeg);
    if (LIKELY(!result)) {
    frame_yuyv = draw_preview_one(frame_yuyv, &mPreviewWindow, uvc_any2rgbx, 4);
    addCaptureFrame(frame_yuyv);
    } else {
    uvc_free_frame(frame_yuyv);
    }
    }
    }

    of course you need to add “frame_mjpeg” and “frame_yuyv” variables instead of “frame” variavle.

1件の投稿を表示中 - 1 - 1件目 (全1件中)

このトピックに返信するにはログインが必要です。