Ask Your Question

VideoCurious's profile - activity

2017-06-02 16:24:15 -0600 commented question opencv with non default python executable

It means that it is aware of the path for both Python 2 and Python 3 interpreters, and it is using Python 2 for the build process. I've successfully built the OpenCV bindings for the Python 3 interpreter when Python 2 is being used for the build process so you should be fine. If CMake is not auto detecting the other Python related build variables you may want to specify those as well. See step 4 in Installation in Linux

[optional] Building python. Set the following python parameters:
PYTHON2(3)_EXECUTABLE = <path to python>
PYTHON_INCLUDE_DIR = /usr/include/python<version>
PYTHON_INCLUDE_DIR2 = /usr/include/x86_64-linux-gnu/python<version>
PYTHON_LIBRARY = /usr/lib/x86_64-linux-gnu/libpython<version>.so
2017-06-02 11:56:36 -0600 commented question Video Stabilization Output Length Change

I still haven't figured out why the FPS is not as I assign or why the video length changes. I'm surprised no one has noticed the FPS issue.

2017-06-02 11:51:45 -0600 commented answer easy video process but very slow

0x00000021 appears to be H263I if I counted the enum values correctly, that is AV_CODEC_ID_H263I. See AVCodecID enum in FFmpeg/libavcodec/avcodec.h. Also see opencv/modules/videoio/src/ffmpeg_codecs.hpp.

2017-05-30 11:25:48 -0600 received badge  Necromancer (source)
2017-05-30 11:16:44 -0600 answered a question Face detection looking down

I think you might have to create your own haar cascade classifier given the ones packaged with OpenCV are more frontal or profile and are not working for you.

2017-05-19 10:51:59 -0600 received badge  Supporter (source)
2017-05-19 09:59:17 -0600 answered a question easy video process but very slow

I'm leaning towards the optical flow calculation, but you should add duration calculations to various operations to narrow down what operations are taking more time.

I've seen the type of errors you mentioned. I believe this has something to do with lack of codec-container support in OpenCV. Try changing your output video filename to end in ".avi". See further discussion in the thread Videowriter recording MP4 + X264 (OpenCV 3.1).

OpenCV: FFMPEG: tag 0x34363258/'X264' is not supported with codec id 28 and format 'mp4 / MP4 (MPEG-4 Part 14)' OpenCV: FFMPEG: fallback to use tag 0x00000021/'!???'

2017-05-12 16:14:52 -0600 received badge  Enthusiast
2017-05-11 15:20:14 -0600 answered a question C++ opencv

This seems feasible and I would suggest spending some time doing research on the problem space. I just found a blog post from Adrian Rosebrock on Eye blink detection with OpenCV, Python, and dlib that might be a good starting point for you.

2017-05-09 16:23:33 -0600 commented question Video Stabilization Output Length Change

I asked the question because I'm not certain what is happening exactly. I'd love to see what happens if VideoWriter encoded the video at 30.303030 fps as I'm requesting. It should be alright unless the fps is not the only problem. I wish someone familiar with the videostab code would respond! I appreciate you taking the time to provide a possible workaround, while it might work it would not be suitable for my needs.

2017-05-04 15:50:42 -0600 commented question Video Stabilization Output Length Change

I appreciate the suggestion. Given the stabilized video is slightly longer I'm thinking the audio sync issue would still exist.

2017-05-04 15:22:26 -0600 received badge  Necromancer (source)
2017-05-04 11:04:16 -0600 answered a question Add audio channel to a video created with OpenCv

You could use FFmpeg to add audio to the video you created with OpenCV. I believe the command would look something like the following:

ffmpeg -i <sourceVideoFile> -i <sourceAudioFile> -map 0:0 -map 1:0 -c:v copy -c:a copy <outputVideoFile>

Source: Add sound tracks to a video file with FFmpeg

2017-05-03 13:37:59 -0600 received badge  Editor (source)
2017-05-03 13:37:13 -0600 asked a question Video Stabilization Output Length Change

I'm performing video stabilization in OpenCV 3.2.0 using code from the videostab sample reduced down to simply perform one pass stabilization using OnePassStabilizer with a GaussianMotionFilter. The code was also enhanced to copy the source codec to the output writer. However, after copying the audio track from the original video to the stabilized video with FFmpeg I noticed that the audio wasn't correctly aligned. Further inspection revealed that the stabilized video (3:49.03) is slightly longer than the input video (3:47.05). The OpenCV code copies the source FPS to the output FPS, however, when comparing the frame rate in VLC the original video appears as 30.303030 while the stabilized video appears as 30.

Why is the stabilized video slightly longer than the original? Why is the stabilized video frame rate rounded down?

FFmpeg information for input video:

$ ffmpeg -i original.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'original.mp4':
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isom3gp4
    creation_time   : 2016-02-25T14:09:56.000000Z   Duration: 00:03:47.05, start:
0.000000, bitrate: 4593 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 4498 kb/s, SAR 1:1 DAR 16:9, 30.30 fps, 30 tbr, 90k tbn, 180k tbc (default)
      creation_time   : 2016-02-25T14:09:56.000000Z
      handler_name    : VideoHandle
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
      creation_time   : 2016-02-25T14:09:56.000000Z
      handler_name    : SoundHandle At least one output file must be specified

FFmpeg information for stabilized video:

$ ffmpeg -i videostab.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'videostab.mp4':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.1.0
  Duration: 00:03:49.03, start: 0.000000, bitrate: 2449 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 2446 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (default)
      handler_name    : VideoHandler
At least one output file must be specified