EasyCapデバイスのマニュアルのほとんどは、古い断片化された不完全なものが多いようです。
これは、Linuxシステム(ソフトウェア/ファームウェア)を皆さんと一緒に獲得するためへの挑戦です。
デバイスの識別 Identify your device
あなたが使用するデバイスがサポートされているかどうかを知るために、
ターミナルで次のコマンドを入力します。
lsusb --->> 下記のようなデータが表示出力されるはずです。
Bus XXX Device XXX: ID 1c88:0007 Somagic, Inc.
ファームウエアを導入後 (see installation)には、下記のようなデータ表示を得ることができるでしょう。
Bus XXX Device XXX: ID 1c88:003c Somagic, Inc. (or)
Bus XXX Device XXX: ID 1c88:003f Somagic, Inc.
インストール Installation
「 somagic_firmware.bin 」のダウンロード(右中程の"Download"ボタン・クリック):
https://github.com/stevelacy/EasyCap/blob/master/somagic_firmware.bin
ファームウェアのコピー
sudo cp ./somagic_firmware.bin /lib/firmware/somagic_firmware.bin
依存する環境をインストール Install dependencies
- make
- gcc
- libusb-1.0-0-dev
- libgcrypt11-dev
Example for debian/ubuntu
sudo apt-get install make gcc libusb-1.0-0-dev libgcrypt11-dev
"mplayer" も必要となるので~ここでインストールしておきます。
sudo apt-get install mplayer2
ターミナルで、ソースファイルを取得する必要があります。
sudo wget https://easycap-somagic-linux.googlecode.com/files/somagic-easycap_1.1.tar.gz
sudo wget https://easycap-somagic-linux.googlecode.com/files/somagic-easycap-tools_1.1.tar.gz
上記のターミナルで取得した~TAR Archives 2個を解凍。
sudo tar xvf somagic-easycap_1.1.tar.gz
sudo tar xvf somagic-easycap-tools_1.1.tar.gz
ソースのコンパイル
cd somagic-easycap_1.1
make
sudo make install
If you wish to install the beta version:
make beta
sudo make install-beta
結果 Results
Now, you have installed:
- somagic-init
- somagic-capture
- somagic-audio-capture
- somagic-both
詳細な手順については次項目の「ユーザーズ・ガイド」をお読みください。
ユーザーズ・ガイド
コマンドの説明 Command description
コマンドを起動する前に、ツールをインストールしてください。
somagic-init ............ファームウェアをロードし、easycapデバイスに接続し、プロセス制御の初期化。
somagic-capture .....ビデオ記録、出力を「stdout」で生ストリーム。
somagic-audio-capture .....オーディオ録音、出力を「stdout」で生ストリーム。
somagic-both ........... ビデオとオーディオの記録、標準でビデオおよび音声の出力。
The format of the raw video and audio depends on the options your choose. Your can find more information using man page (or in the examples below)
man somagic-capture
ビデオのライブ視覚化 Live visualization of the video
依存関係 Dependencies ● mplayer
PAL format
# kill untracked zombie processes (could be usefull if the script is killed)
sudo killall -9 somagic-capture
# init the somagic driver
sudo somagic-init
sudo somagic-capture | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -
NTSC format
# kill untracked zombie processes (could be usefull if the script is killed)
sudo killall -9 somagic-capture
# init the somagic driver
sudo somagic-init
# recording
sudo somagic-capture -n | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "ntsc:format=uyvy:fps=30000/1001" -aspect 4:3 -
SECAM format
# kill untracked zombie processes (could be usefull if the script is killed)
sudo killall -9 somagic-capture
# init the somagic driver
sudo somagic-init
# recording
sudo somagic-capture --secam | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -
ビデオの録画とオーディオ Record video and audio.
This section is a cookbook. Feel free to add yours solutions!
Dependencies:
libav-tools (avconv)
moreutils (buffer)
Secam format
sudo killall -9 somagic-both
sudo killall -9 somagic-capture
# init the somagic driver
sudo somagic-init
# recording
rm -f .video .audio .video_buffer .audio_buffer
mkfifo .video .audio .video_buffer .audio_buffer
sudo somagic-both --secam 1>.video 2>.audio & pid=$!
# buffer the data acquired (prevent frame lost)
buffer < .video > .video_buffer &
buffer < .audio > .audio_buffer &
sleep 1
avconv \
-f rawvideo -pix_fmt uyvy422 -r 25 -s:v 720x576 -i .video_buffer \
-f s16le -sample_rate 24000 -ac 2 -i .audio_buffer -strict experimental \
-vcodec mpeg4 -vtag xvid -qscale:v 7 \
-vf yadif -s:v 720x540 \
video.avi
# now, type ctrl-c to stop the encoding
# you can then kill somagic-both
マニュアル ページ Man pages
MAN page from OpenSuSE 13.X somagic-easycap-1.1-4.1.x86_64.rpm
somagic-capture
Section: Somagic EasyCAP (1)
Updated: March 2013
Index
NAME
somagic-capture - Perform video capture with the Somagic EasyCAP DC60, Somagic EasyCAP002, or EzCAP USB 2.0
書式 SYNOPSIS
somagic-capture[OPTION]...
説明 DESCRIPTION
Initializes the Somagic EasyCAP DC60, Somagic EasyCAP002, or EzCAP ESB 2.0 registers and performs video capture.This program must be run as root in order to interact with the USB capture device directly.
オプション OPTIONS
-B, --brightness=VALUE
Luminance brightness control.The brightness VALUE must be between 0 and 255, inclusive.The default brightness is 128, which selects the ITU level.
値 VALUE |
輝度 Brightness |
255 |
Bright |
149 |
NTSC-J |
128 |
ITU level |
0 |
Dark |
-C, --contrast=VALUE
Luminance contrast control.The contrast VALUE must be between -128 and 127, inclusive.The default contrast is 71, which selects the ITU level.
値 VALUE |
コントラスト Contrast |
127 |
1.984375 |
|
72 |
1.125000 |
NTSC-J |
71 |
1.109375 |
ITU level |
64 |
1.000000 |
|
1 |
0.015625 |
|
0 |
0.000000 |
Luminance off |
-64 |
-1.000000 |
Inverse luminance |
-128 |
-2.000000 |
Inverse luminance |
-c, --cvbs
For the EasyCAP DC60 or EzCAP USB 2.0, use the CVBS (composite) input for video capture.For the EasyCAP002, use the numbered inputs for video capture. Different devices seem to have different numbering schemes, so try each input in turn to determine which one is correct. This is the default.
-i, --cvbs-inputVALUE
For the EasyCAP002 only. Select the numbered input to use.Different devices seem to have different numbering schemes, so the numbering may not match your device. Try each input in turn to determine which one is correct. The default input is 3.
-f, --framesCOUNT
Maximum number of video frames to capture.The default is -1, which allows unlimited frames.
--help
印刷プログラムの使用方法および使用例。
-H, --hue=VALUE
Hue phase in degrees.The hue VALUE must be between -128 and 127, inclusive.The default hue is 0.
値 VALUE |
位相 Phase |
-128 |
-180.00000° |
0 |
0.00000° |
1 |
1.40635° |
127 |
178.59375° |
--iso-transfers=COUNT
Number of concurrent iso transfers.Selecting a higher value might help alleviate sync artifacts.The default is 4.
--lum-aperture=MODE
Luminance aperture factor.The aperture factor MODE must be between 0 and 3, inclusive.Increasing this value can increase perceived sharpness.The default aperture factor is 1.
モード MODE |
Aperture Factor |
0 |
0.00 |
1 |
0.25 |
2 |
0.50 |
3 |
1.00 |
--lum-prefilter
Activate the luminance prefilter.This is bypassed (not active) by default.
--luminance=MODE
Luminance mode for the CVBS video input, selecting a center frequency in MHz.Does not apply to the S-VIDEO video input.The MODE must be between 0 and 3, inclusive.Decreasing the MHz value can increase perceived sharpness.The default is 0.
モード MODE |
中心周波数 Center Frequency |
0 |
4.1 MHz |
1 |
3.8 MHz |
2 |
2.6 MHz |
3 |
2.9 MHz |
0
1
2
3
-n, --ntsc
Decode the NTSC-M video standard, which is used in North America.To decode the NTSC-J video standard, which is used in Japan, select -n along with -B 147 and -C 72.The internal vertical resolution is 525 lines. The output resolution is 720x480, which should be scaled to 720x540 for the correct aspect ratio of 4:3.The output framerate is approximately 29.97 Hz, or 30/1.001 Hz exactly.
--ntsc-4.43-50
Decode the NTSC-4.43 50 Hz video standard.The internal vertical resolution is 525 lines. The output resolution is 720x480, which should be scaled to 720x540 for the correct aspect ratio of 4:3.The output framerate is 25 Hz exactly.
--ntsc-4.43-60
Decode the NTSC-4.43 60 Hz video standard.The internal vertical resolution is 525 lines. The output resolution is 720x480, which should be scaled to 720x540 for the correct aspect ratio of 4:3.The output framerate is approximately 29.97 Hz, or 30/1.001 Hz exactly.
--ntsc-n
Decode the NTSC-N video standard.The internal vertical resolution is 625 lines. The output resolution is 720x576, which should be scaled to 720x540 for the correct aspect ratio of 4:3.The output framerate is 25 Hz exactly.
-p, --pal
Decode any of the PAL-B, PAL-G, PAL-H, PAL-I, or PAL-N video standards, which are used in many regions.The internal vertical resolution is 625 lines. The output resolution is 720x576, which should be scaled to 720x540 for the correct aspect ratio of 4:3.The output framerate is 25 Hz exactly.This is the default.
--pal-4.43
Decode the PAL-4.43 video standard, also commonly known as PAL 60.The internal vertical resolution is 525 lines. The output resolution is 720x480, which should be scaled to 720x540 for the correct aspect ratio of 4:3.The output framerate is approximately 29.97 Hz, or 30/1.001 Hz exactly.
--pal-m
Decode the PAL-M video standard, which is used in Brazil.The internal vertical resolution is 525 lines. The output resolution is 720x480, which should be scaled to 720x540 for the correct aspect ratio of 4:3.The output framerate is approximately 29.97 Hz, or 30/1.001 Hz exactly.
--pal-combination-n
Decode the PAL Combination-N video standard.The internal vertical resolution is 625 lines. The output resolution is 720x576, which should be scaled to 720x540 for the correct aspect ratio of 4:3.The output framerate is 25 Hz exactly.
-C, --contrast=VALUE
Chrominance saturation control.The saturation VALUE must be between -128 and 127, inclusive.The default saturation is 64, which selects the ITU level.
VALUE |
彩度 Saturation |
127 |
1.984375 |
|
64 |
1.000000 |
ITU level |
1 |
0.015625 |
|
0 |
0.000000 |
Color off |
-64 |
-1.000000 |
Inverse chrominance |
-128 |
-2.000000 |
Inverse chrominance |
-s, --s-video
Use the S-VIDEO input for video capture. Only available on EasyCAP DC60 and EzCAP USB 2.0.
--secam
Decode the SECAM video standard.The internal vertical resolution is 625 lines. The output resolution is 720x576, which should be scaled to 720x540 for the correct aspect ratio of 4:3.The output framerate is 25 Hz exactly.
--sync=VALUE
Sync algorithm. Selects the method used to decode the video and control information into frames of video.The sync VALUE must be either 1 or 2.The default is 2.
値 VALUE |
アルゴリズム Algorithm |
1 |
TB |
2 |
MD |
--test-only
Parses command-line options and performs capture setup, but does not initiate capture.The purpose of this option is to allow scripts to determine whether capture should be possible.
--vo=FILENAME
Select a file (or pipe) to output raw UYVY video frames to.The default is to output video to standard output rather than a file.
--version
Print the program version, the program copyright, a list of authors, and a notice that there is no warranty.
終了ステータス EXIT STATUS
The program exits with a status of zero on success.A status of one will be returned if any errors were encountered.
例 EXAMPLES
Play PAL video from CVBS/composite input
somagic-capture | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -
Play PAL video from S-VIDEO input
somagic-capture -s | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -
Play PAL video from CVBS/composite with increased sharpness
somagic-capture --luminance=2 --lum-aperture=3 | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -
Play NTSC video from CVBS/composite input
somagic-capture -n | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "ntsc:format=uyvy:fps=30000/1001" -aspect 4:3 -Play NTSC video from S-VIDEO inputsomagic-capture -n -s | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "ntsc:format=uyvy:fps=30000/1001" -aspect 4:3 -
Play NTSC video from CVBS/composite input with increased sharpness
somagic-capture -n --luminance=2 --lum-aperture=3 | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "ntsc:format=uyvy:fps=30000/1001" -aspect 4:3 -
Play NTSC video from CVBS/composite input with increased sharpness, using alternate sync algorithm
somagic-capture -n --luminance=2 --lum-aperture=3 --sync=1 | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "ntsc:format=uyvy:fps=30000/1001" -aspect 4:3 -
Play SECAM video from CVBS/composite input
somagic-capture --secam | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=25" -aspect 4:3 -
SEE ALSO
somagic-extract-firmware(1), somagic-init(1)
REPORTING BUGS
Report bugs to the easycap-somagic-linux project on Google Project Hosting:
AUTHOR
This manual page was written by Jeffry Johnston .
COPYRIGHT
Copyright © 2011-2013 Tony Brown, Michal Demin, Jeffry Johnston, Jon Arne Jørgensen.License GPLv2+: GNU GPL version 2 or later .
This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law.
Index
NAME
SYNOPSIS
DESCRIPTION
OPTIONS
EXIT STATUS
EXAMPLES
SEE ALSO
REPORTING BUGS
AUTHOR
COPYRIGHT
【2016.08.08.】 やっとのこと、下の写真のような画像を取得しました・・・?
でも、映像の固定をする方法が見つかりません。ジー爺の徘徊は続きます~^^;
pi@raspberrypi:~ $ lsusb
Bus 001 Device 005: ID 1c88:003c Somagic, Inc. SMI Grabber (EasyCAP DC60+ clone) [SMI-2021CBE]
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~ $ sudo somagic-capture | mplayer -vf yadif,screenshot -demuxer rawvideo -rawvideo "pal:format=uyvy:fps=10" -aspect 4:3 -
MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
Cannot open file '/home/pi/.mplayer/input.conf': No such file or directory
Failed to open /home/pi/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf. ⇦ ⇧ ここが修正ポイントかも~?
Playing -.
Reading from stdin...
Detected file format: rawvideo
Load subtitles in .
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
[VO_XV] It seems there is no Xvideo support for your video card available.
[VO_XV] Run 'xvinfo' to verify its Xv support and read
[VO_XV] DOCS/HTML/en/video.html#xv!
[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.
[VO_XV] Try -vo x11.
[ass] auto-open
Opening video filter: [screenshot]
Opening video filter: [yadif]
VIDEO: 720x576 10.000 fps 66355.2 kbps (8294.4 kB/s)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
Aspect ratio is 1.33:1 - scaling to correct movie aspect.
[swscaler @ 0x75ad5980]using unscaled uyvy422 -> yuv420p special converter
VO: [x11] 720x576 => 768x576 Planar YV12
[swscaler @ 0x75ad5980]No accelerated colorspace conversion found from yuv420p to rgb565le.
Selected video codec: RAW UYVY [raw]
Audio: no sound
Starting playback...
V: 23.4 235/235 0% 81% 0.0% 0 0
Exiting... (End of file)
copyright 悠流里 Since: 2002.07.20.