Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jnohlgard/python-v4l2capture
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: TimSC/libvideolive
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Sep 1, 2013

  1. Copy the full SHA
    08828ef View commit details

Commits on Sep 12, 2013

  1. Support more pixel formats

    TimSC committed Sep 12, 2013
    Copy the full SHA
    b6ba872 View commit details

Commits on Sep 13, 2013

  1. Update docstrings

    TimSC committed Sep 13, 2013
    Copy the full SHA
    3203f70 View commit details

Commits on Oct 17, 2013

  1. Copy the full SHA
    057ca07 View commit details
  2. Return pixel format information

    TimSC committed Oct 17, 2013
    Copy the full SHA
    c1b5bd2 View commit details

Commits on Oct 18, 2013

  1. Copy the full SHA
    c5253ad View commit details
  2. Huffman table insert now works

    TimSC committed Oct 18, 2013
    Copy the full SHA
    9402b47 View commit details

Commits on Oct 20, 2013

  1. Add device manager object

    TimSC committed Oct 20, 2013
    Copy the full SHA
    3d46536 View commit details
  2. Construct a video device

    TimSC committed Oct 20, 2013
    Copy the full SHA
    4760bf2 View commit details
  3. Move to use C++

    TimSC committed Oct 20, 2013
    Copy the full SHA
    5464d80 View commit details
  4. Create buffers

    TimSC committed Oct 20, 2013
    Copy the full SHA
    4bd6a57 View commit details
  5. Copy the full SHA
    d0d944b View commit details
  6. Start and stop function works

    TimSC committed Oct 20, 2013
    Copy the full SHA
    66faa42 View commit details
  7. Fix segfault in stop

    TimSC committed Oct 20, 2013
    Copy the full SHA
    105a30e View commit details
  8. Copy the full SHA
    39b313f View commit details
  9. Tidy code

    TimSC committed Oct 20, 2013
    Copy the full SHA
    f86020d View commit details
  10. Tidy code

    TimSC committed Oct 20, 2013
    Copy the full SHA
    0e05ba7 View commit details
  11. Properly do deinit

    TimSC committed Oct 20, 2013
    Copy the full SHA
    7139816 View commit details
  12. Copy the full SHA
    d59be19 View commit details
  13. Change license to GPL

    TimSC committed Oct 20, 2013
    Copy the full SHA
    c55d5f3 View commit details
  14. Problems reading frame

    TimSC committed Oct 20, 2013
    Copy the full SHA
    74535a2 View commit details
  15. Copy the full SHA
    b123b54 View commit details
  16. Copy the full SHA
    6450b12 View commit details
  17. Copy the full SHA
    c93f455 View commit details
  18. Copy the full SHA
    83b5afe View commit details
  19. Copy the full SHA
    ac7f2aa View commit details
  20. Still not found bug

    TimSC committed Oct 20, 2013
    Copy the full SHA
    3927998 View commit details
  21. Copy the full SHA
    8bbb2b4 View commit details
  22. Copy the full SHA
    c98659a View commit details
  23. Broke something, segfaults

    TimSC committed Oct 20, 2013
    Copy the full SHA
    72cb6c8 View commit details
  24. Copy the full SHA
    f2fa97e View commit details
  25. Update doc strings

    TimSC committed Oct 20, 2013
    Copy the full SHA
    a85cf9e View commit details
  26. Copy the full SHA
    9637f12 View commit details

Commits on Oct 21, 2013

  1. Copy the full SHA
    e3ddbbb View commit details
  2. Copy the full SHA
    44cdbe5 View commit details
  3. Change set format to be async

    TimSC committed Oct 21, 2013
    Copy the full SHA
    14791b7 View commit details
  4. Copy the full SHA
    422464d View commit details
  5. Insert huffman table

    TimSC committed Oct 21, 2013
    Copy the full SHA
    83e31a0 View commit details
  6. Using libjpeg but now segfaults

    TimSC committed Oct 21, 2013
    Copy the full SHA
    f5b30e9 View commit details
  7. MJpeg appears to decode

    TimSC committed Oct 21, 2013
    Copy the full SHA
    ace6198 View commit details
  8. Return image to python

    TimSC committed Oct 21, 2013
    Copy the full SHA
    3790e09 View commit details
  9. Copy the full SHA
    73ff770 View commit details
  10. Copy the full SHA
    718b291 View commit details
  11. Set format automagically

    TimSC committed Oct 21, 2013
    Copy the full SHA
    0c06294 View commit details
  12. Remove hard coded rgb

    TimSC committed Oct 21, 2013
    Copy the full SHA
    b9edfc8 View commit details
  13. Add YUYV decoding

    TimSC committed Oct 21, 2013
    Copy the full SHA
    08e10b6 View commit details
  14. Skip conversion if not needed

    TimSC committed Oct 21, 2013
    Copy the full SHA
    f297813 View commit details
  15. Pass meta data to python

    TimSC committed Oct 21, 2013
    Copy the full SHA
    3ddabe4 View commit details
  16. Fix meta data

    TimSC committed Oct 21, 2013
    Copy the full SHA
    bdbbf7c View commit details
  17. Copy the full SHA
    fc5bcbe View commit details
Showing with 8,334 additions and 727 deletions.
  1. +1 −1 MANIFEST
  2. +28 −29 README
  3. +91 −0 base.h
  4. +0 −47 capture_picture.py
  5. +0 −54 capture_picture_delayed.py
  6. +339 −0 gpl-2.0.txt
  7. +312 −0 libvideolive.cpp
  8. +0 −28 list_devices.py
  9. +1,259 −0 mfvideoin.cpp
  10. +81 −0 mfvideoin.h
  11. +75 −0 mfvideoout.cpp
  12. +31 −0 mfvideoout.h
  13. +561 −0 mfvideooutfile.cpp
  14. +55 −0 mfvideooutfile.h
  15. +473 −0 namedpipeout.cpp
  16. +45 −0 namedpipeout.h
  17. +1,100 −0 pixfmt.cpp
  18. +47 −0 pixfmt.h
  19. +50 −19 setup.py
  20. +0 −549 v4l2capture.c
  21. +747 −0 v4l2capture.cpp
  22. +134 −0 v4l2capture.h
  23. +392 −0 v4l2out.cpp
  24. +53 −0 v4l2out.h
  25. +279 −0 videoin.cpp
  26. +38 −0 videoin.h
  27. +37 −0 videoin.py
  28. +167 −0 videoout.cpp
  29. +28 −0 videoout.h
  30. +31 −0 videoout.py
  31. +289 −0 videooutfile.cpp
  32. +29 −0 videooutfile.h
  33. +44 −0 videooutfile.py
  34. +17 −0 winsource/resource.h
  35. +870 −0 winsource/winsource.cpp
  36. +9 −0 winsource/winsource.def
  37. +131 −0 winsource/winsource.h
  38. +88 −0 winsource/winsource.rc
  39. +26 −0 winsource/winsource.sln
  40. +208 −0 winsource/winsource.vcxproj
  41. +20 −0 wintest/wintest.sln
  42. +40 −0 wintest/wintest/ReadMe.txt
  43. +19 −0 wintest/wintest/wintest.cpp
  44. +90 −0 wintest/wintest/wintest.vcxproj
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
@@ -3,4 +3,4 @@ capture_picture.py
capture_picture_delayed.py
list_devices.py
setup.py
v4l2capture.c
v4l2capture.cpp
57 changes: 28 additions & 29 deletions README
Original file line number Diff line number Diff line change
@@ -1,57 +1,56 @@
python-v4l2capture 1.4.x
Python extension to capture video with video4linux2
libvideolive
Capture and stream video in python

2009, 2010, 2011 Fredrik Portstrom
2011 Joakim Gebart
2013 Tim Sheerman-Chase

I, the copyright holder of this file, hereby release it into the
public domain. This applies worldwide. In case this is not legally
possible: I grant anyone the right to use this work for any purpose,
without any conditions, unless such conditions are required by law.
This software may be used and redistributed under the terms of the GPL v2 (or later) license.

Introduction
============

python-v4l2capture is a slim and easy to use Python extension for
capturing video with video4linux2. It supports libv4l to convert any
image format to RGB or YUV420.
libvideolive is a slim and easy to use Python extension for
capturing and streaming video.

this fork of python-v4l2capture: https://github.com/gebart/python-v4l2capture

original python-v4l2capture: http://fredrik.jemla.eu/v4l2capture

libv4l: http://freshmeat.net/projects/libv4l

Installation
============
Installation on Linux
=====================

libvideolive on linux requires libv4l by default. You can do so by erasing ', libraries = ["v4l2"]'
in setup.py and erasing '#define USE_LIBV4L' in v4l2capture.cpp.

libvideolive uses distutils to compile. For Linux:

./setup.py build
sudo ./setup.py install

Installation on Windows
=====================

v4l2capture requires libv4l by default. You can compile v4l2capture
without libv4l, but that reduces image format support to YUYV input
and RGB output only. You can do so by erasing ', libraries = ["v4l2"]'
in setup.py and erasing '#define USE_LIBV4L' in v4l2capture.c.
Modify setup.py to specify locations of libjpeg and pthread external libraries.

python-v4l2capture uses distutils.
To build: ./setup.py build
To build and install: ./setup.py install
With Visual Studio 2010:

SET VS90COMNTOOLS=%VS100COMNTOOLS%
python setup.py build -c msvc
python setup.py install

Remember to put the libjpeg and pthread dlls somewhere appropriate.

Example
=======

See capture_picture.py, capture_picture_delayed.py and list_devices.py.
To do

Change log
==========

(see git log for latest changes)

1.4 (2011-03-18) - Added support for YUV420 output.

1.3 (2010-07-21) - Added set of capabilities to the return value of
get_info. Updated list_devices.py.

1.2 (2010-04-01) - Forked example script into capture_picture.py and
capture_picture_delayed.py.

1.1 (2009-11-03) - Updated URL and documentation.

1.0 (2009-02-28) - Initial release.
91 changes: 91 additions & 0 deletions base.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

#ifndef BASE_H
#define BASE_H

#include <string>

class FrameMetaData
{
public:
std::string fmt;
int width;
int height;
unsigned buffLen;
unsigned long sequence;
unsigned long tv_sec;
unsigned long tv_usec;

FrameMetaData()
{
width = 0;
height = 0;
buffLen = 0;
sequence = 0;
tv_sec = 0;
tv_usec = 0;
}

FrameMetaData(const FrameMetaData &in)
{
FrameMetaData::operator=(in);
}

const FrameMetaData &operator=(const FrameMetaData &in)
{
width = in.width;
height = in.height;
fmt = in.fmt;
buffLen = in.buffLen;
sequence = in.sequence;
tv_sec = in.tv_sec;
tv_usec = in.tv_usec;
return *this;
}

};

class Base_Video_In
{
public:
Base_Video_In() {};
virtual ~Base_Video_In() {};

virtual void Stop() {};
virtual void WaitForStop() {};
virtual void OpenDevice() {};
virtual void SetFormat(const char *fmt, int width, int height) {};
virtual void StartDevice(int buffer_count) {};
virtual void StopDevice() {};
virtual void CloseDevice() {};
virtual int GetFrame(unsigned char **buffOut, class FrameMetaData *metaOut) {return 0;};

void Run() {};
};

// **********************************************************************

class Base_Video_Out
{
public:
Base_Video_Out() {};
virtual ~Base_Video_Out() {};

virtual void SendFrame(const char *imgIn,
unsigned imgLen,
const char *pxFmt,
int width,
int height,
unsigned long tv_sec = 0,
unsigned long tv_usec = 0) {};
virtual void Stop() {};
virtual int WaitForStop() {return 1;};
virtual void SetOutputSize(int width, int height) {};
virtual void SetOutputPxFmt(const char *fmt) {};
virtual void SetFrameRate(unsigned int frameRateIn) {};
virtual void SetVideoCodec(const char *codec, unsigned int bitrate) {};

void Run() {};
};

#endif //BASE_H

47 changes: 0 additions & 47 deletions capture_picture.py

This file was deleted.

54 changes: 0 additions & 54 deletions capture_picture_delayed.py

This file was deleted.

Loading