Ask Your Question

sameer's profile - activity

2016-12-23 10:28:44 -0600 received badge  Notable Question (source)
2015-05-12 06:24:32 -0600 received badge  Popular Question (source)
2013-04-04 12:35:03 -0600 asked a question Writing an MP4 file on the Mac with OpenCV ffmpeg

I am using OpenCV with ffmpeg on a mac to write video. I've been able to successfully write .avi files using the codec/fourcc code, FMP4. I would like to write .mp4 files, however. When I try to write an .mp4 file using fourcc FMP4 I get this error:

[mp4 @ 0x100b4ec00] Tag FMP4/0x34504d46 incompatible with output codec id '13' ( [0][0][0])

When I use AVC1 I get the following error:

[libx264 @ 0x104003000] broken ffmpeg default settings detected
[libx264 @ 0x104003000] use an encoding preset (e.g. -vpre medium)
[libx264 @ 0x104003000] preset usage: -vpre <speed> -vpre <profile>
[libx264 @ 0x104003000] speed presets are listed in x264 --help
[libx264 @ 0x104003000] profile is optional; x264 defaults to high
Could not open codec 'libx264': Unspecified error

Does anyone here know the right codec to use with OpenCV and ffmpeg to write to an MP4 container on the Mac?

If AVC1 is the right codec, how do I install ffmpeg + OpenCV correctly? I did

brew install gpac
brew install ffmpeg
brew install opencv

The call I am using to open the videowriter:

fourcc = cv2.cv.CV_FOURCC('A', 'V', 'C', '1')   
video_out = cv2.VideoWriter(
    filename=output_filename,
    fourcc=fourcc,
    fps=video_fps,
    frameSize=(video_width,video_height),
    isColor=1)

When I run x264 --help I get

% x264 --help
x264 core:125
Syntax: x264 [options] -o outfile infile

Infile can be raw (in which case resolution is required),
  or YUV4MPEG (*.y4m),
  or Avisynth if compiled with support (no).
  or libav* formats if compiled with lavf support (no) or ffms support (no).
Outfile type is selected by filename:
 .264 -> Raw bytestream
 .mkv -> Matroska
 .flv -> Flash Video
 .mp4 -> MP4 if compiled with GPAC support (no)
Output bit depth: 8 (configured at compile time)

Options:

  -h, --help                  List basic options
      --longhelp              List more options
      --fullhelp              List all options

Example usage:

      Constant quality mode:
            x264 --crf 24 -o <output> <input>

      Two-pass with a bitrate of 1000kbps:
            x264 --pass 1 --bitrate 1000 -o <output> <input>
            x264 --pass 2 --bitrate 1000 -o <output> <input>

      Lossless:
            x264 --qp 0 -o <output> <input>

      Maximum PSNR at the cost of speed and visual quality:
            x264 --preset placebo --tune psnr -o <output> <input>

      Constant bitrate at 1000kbps with a 2 second-buffer:
            x264 --vbv-bufsize 2000 --bitrate 1000 -o <output> <input>

Presets:

      --profile <string>      Force the limits of an H.264 profile
                                  Overrides all settings.
                                  - baseline,main,high,high10,high422,high444
      --preset <string>       Use a preset to select encoding settings [medium]
                                  Overridden by user settings.
                                  - ultrafast,superfast,veryfast,faster,fast
                                  - medium,slow,slower,veryslow,placebo
      --tune <string>         Tune the settings for a particular type of source
                              or situation
                                  Overridden by user settings.
                                  Multiple tunings are separated by commas.
                                  Only one psy tuning can be used at a time.
                                  - psy tunings: film,animation,grain,
                                                 stillimage,psnr,ssim
                                  - other tunings: fastdecode,zerolatency

Frame-type options:

  -I, --keyint <integer or "infinite"> Maximum GOP size [250]
      --tff                   Enable interlaced mode (top field first)
      --bff                   Enable interlaced mode (bottom field first)
      --pulldown <string>     Use soft pulldown to change frame rate
                                  - none, 22, 32, 64, double, triple, euro (requires ...
(more)
2012-09-26 07:38:09 -0600 asked a question Image clipping with mechanical turk

Hi everyone -- I have a lot of images I need to clip in order to train a cascade. I am wondering if anyone has implemented a mechanical turk app for image clipping? I found a paper:

http://husk.eecs.berkeley.edu/courses/cs298-52-sp11/images/0/0c/SallyDraft.pdf

but the code doesn't appear to be available. Is anyone aware of some code available that can implement image clipping on mechanical turk?

Thanks

2012-08-06 11:02:37 -0600 received badge  Student (source)
2012-08-03 17:52:16 -0600 asked a question matchContourTrees in C++ API

Hello. I am reading about contour trees and the cvMatchContourTrees fn in the book Learning OpenCV. However it doesn't appear to be available via the C++ API. It is in the legacy/legacy.hpp file. Has it been deprecated? Is there something else that should be used instead?

Thanks -s