#ひさしい書きこみ(^^;
私が愛用しているデジカメです。
コンパクトなボディですが動画も撮れる代物で、ムービの様に気合をいれなくても映像を記録できるところがよいです。勿論長時間というわけにはいきませんけれども、子供のちょっとした仕種をすぐに記録できるのは嬉しい。携帯だろうがデジカメだろうが「静止画より動画」の流れに見事に乗っている気がします。(^^
記録した動画はAVI(Motion JPEG)となっています。(EXZ40のスペック表atCasio)LinuxにxineなどAVIファイルを再生できるソフトをインストールしてあれば問題なく再生できます。(LinuxならUSB接続でさくっとSCSIの外部ストレージとしてマウントします。Windows2000ではドライバ必要)
さて、問題はここから。
撮った動画は両親にも見せるのですが、EX-Z40は撮った動画をその場で再生できるとは言え、保存できる量は少いです。上映会の機会もそんなに無いので、どんどんパソコンの中に動画が溜まってゆきます。このままCD-Rなどに記録して渡してもよいですけれど、パソコン立ち上げて動画をみるなんてめんどうということになりそう。もっと、簡単に見られるようにしてあげないと喜んでもらえない(はず)です。
そこで、実家にはVHSビデオデッキしかないこともあって、DVDプレーヤを置くことにしました。DVD-Video形式なら簡単に動画も見られることでしょう。ムービーで撮った動画も最近のHDDレコーダなら簡単にDVDへ記録できますしネ。
AVIをMPEG2へ
DVD-Video形式では動画のエンコード方法としてMPEG2を採用しています。とりあえず、aviファイルをMPEG2ファイルに変換する必要がありますね。
aviファイルをmpegに変換するツールとしてffmpegを使います。
1 |
[t-randt@mayu tmp]$ ffmpeg -b 2120 -r 14.99 -s 320x240 -i cimg1154.avi -target ntsc-dvd -r 50 -s 320x240 cimg1154.mpeg |
これで一発mpeg2に変換されます。もちろん音声込。(*)
以下は変更前と後のエンコード情報
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
[t-randt@mayu tmp]$ ffmpeg -i cimg1154.avi ffmpeg version 0.4.9-pre1, build 4730, Copyright (c) 2000-2004 Fabrice Bellard configuration: : built on Mar 31 2005 01:07:51, gcc: 3.4.2 20041017 (Red Hat 3.4.2-6.fc3) Input #0, avi, from 'cimg1154.avi': Duration: 00:00:45.5, start: 0.000000, bitrate: 2120 kb/s Stream #0.0: Video: mjpeg, 320x240, 14.99 fps Stream #0.1: Audio: pcm_u8, 8000 Hz, mono, 64 kb/s Must supply at least one output file [t-randt@mayu tmp]$ ffmpeg -i cimg1154.mpeg : Input #0, mpeg, from 'cimg1154.mpeg': Duration: 00:00:44.6, start: 0.500000, bitrate: 2362 kb/s Stream #0.0: Video: mpeg2video, 320x240, 50.00 fps Stream #0.1: Audio: 0x0000 Must supply at least one output file |
ffmpegインストールログ
http://dag.wieers.com/packages/からパッケージをいだだきました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
ffmpeg/ [root@mayu SRPMS]# rpmbuild --rebuild ffmpeg-0.4.9-0.20041110.3.rf.src.rpm ffmpeg-0.4.9-0.20041110.3.rf.src.rpm をインストール中 警告: user dag does not exist - using root 警告: group dag does not exist - using root 警告: user dag does not exist - using root 警告: group dag does not exist - using root 警告: user dag does not exist - using root 警告: group dag does not exist - using root 警告: user dag does not exist - using root 警告: group dag does not exist - using root エラー: Failed build dependencies: faad2 is needed by ffmpeg-0.4.9-0.20041110.3.rf.i386 faac is needed by ffmpeg-0.4.9-0.20041110.3.rf.i386 xvidcore is needed by ffmpeg-0.4.9-0.20041110.3.rf.i386 a52dec is needed by ffmpeg-0.4.9-0.20041110.3.rf.i386 imlib2-devel is needed by ffmpeg-0.4.9-0.20041110.3.rf.i386 faad2-devel is needed by ffmpeg-0.4.9-0.20041110.3.rf.i386 faac-devel is needed by ffmpeg-0.4.9-0.20041110.3.rf.i386 xvidcore-devel is needed by ffmpeg-0.4.9-0.20041110.3.rf.i386 a52dec-devel is needed by ffmpeg-0.4.9-0.20041110.3.rf.i386 [root@mayu SRPMS]# [root@mayu SRPMS]# rpmbuild --rebuild faad2-2.0-2.20040923.rf.src.rpm faad2-2.0-2.20040923.rf.src.rpm をインストール中 警告: user dag does not exist - using root 警告: group dag does not exist - using root 警告: user dag does not exist - using root 警告: group dag does not exist - using root エラー: Failed build dependencies: libsndfile-devel >= 1.0.0 is needed by faad2-2.0-2.20040923.rf.i386 id3lib-devel is needed by faad2-2.0-2.20040923.rf.i386 [root@mayu SRPMS]# [root@mayu SRPMS]# rpmbuild --rebuild libsndfile-1.0.11-1.rf.src.rpm [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/libsndfile-1.0.11-1.rf.i386.rpm Preparing... ########################################### [100%] 1:libsndfile ########################################### [100%] [root@mayu SRPMS]# [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/libsndfile-devel-1.0.11-1.rf.i386.rpm Preparing... ########################################### [100%] 1:libsndfile-devel ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/libsndfile-debuginfo-1.0.11-1.rf.i386.rpm Preparing... ########################################### [100%] 1:libsndfile-debuginfo ########################################### [100%] [root@mayu SRPMS]# [root@mayu i386]# rpm -ivh id3lib-3.8.3-7.1.fc3.rf.i386.rpm 警告: id3lib-3.8.3-7.1.fc3.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 Preparing... ########################################### [100%] 1:id3lib ########################################### [100%] [root@mayu i386]# rpm -ivh id3lib-devel-3.8.3-7.1.fc3.rf.i386.rpm 警告: id3lib-devel-3.8.3-7.1.fc3.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 Preparing... ########################################### [100%] 1:id3lib-devel ########################################### [100%] [root@mayu i386]# [root@mayu i386]# rpm -ivh faac-1.24-1.1.fc3.rf.i386.rpm 警告: faac-1.24-1.1.fc3.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 Preparing... ########################################### [100%] 1:faac ########################################### [100%] [root@mayu i386]# [root@mayu i386]# rpm -ivh faac-devel-1.24-1.1.fc3.rf.i386.rpm 警告: faac-devel-1.24-1.1.fc3.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 Preparing... ########################################### [100%] 1:faac-devel ########################################### [100%] [root@mayu SRPMS]# rpmbuild --rebuild xvidcore-1.0.3-1.rf.src.rpm [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/xvidcore-1.0.3-1.rf.i386.rpm Preparing... ########################################### [100%] 1:xvidcore ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/xvidcore-de xvidcore-debuginfo-1.0.3-1.rf.i386.rpm xvidcore-devel-1.0.3-1.rf.i386.rpm [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/xvidcore-devel-1.0.3-1.rf.i386.rpm Preparing... ########################################### [100%] 1:xvidcore-devel ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/xvidcore-debuginfo-1.0.3-1.rf.i386.rpm Preparing... ########################################### [100%] 1:xvidcore-debuginfo ########################################### [100%] [root@mayu i386]# rpm -ivh a52dec-0.7.4-7.1.fc3.rf.i386.rpm 警告: a52dec-0.7.4-7.1.fc3.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 Preparing... ########################################### [100%] 1:a52dec ########################################### [100%] [root@mayu i386]# rpm -ivh a52dec-devel-0.7.4-7.1.fc3.rf.i386.rpm 警告: a52dec-devel-0.7.4-7.1.fc3.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 Preparing... ########################################### [100%] 1:a52dec-devel ########################################### [100%] [root@mayu SRPMS]# rpmbuild --rebuild faad2-2.0-2.20040923.rf.src.rpm [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/faad2-2.0-2.20040923.rf.i386.rpm Preparing... ########################################### [100%] 1:faad2 ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/xmms-aac-2.0-2.20040923.rf.i386.rpm Preparing... ########################################### [100%] 1:xmms-aac ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/faad2-devel-2.0-2.20040923.rf.i386.rpm Preparing... ########################################### [100%] 1:faad2-devel ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/faad2-debuginfo-2.0-2.20040923.rf.i386.rpm Preparing... ########################################### [100%] 1:faad2-debuginfo ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/imlib2-1.2.0-1.rf.i386.rpm Preparing... ########################################### [100%] 1:imlib2 ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/imlib2-devel-1.2.0-1.rf.i386.rpm Preparing... ########################################### [100%] 1:imlib2-devel ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/imlib2-debuginfo-1.2.0-1.rf.i386.rpm Preparing... ########################################### [100%] 1:imlib2-debuginfo ########################################### [100%] [root@mayu SRPMS]# rpmbuild --rebuild ffmpeg-0.4.9-0.20041110.3.rf.src.rpm [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/libpostproc-0.4.9-0.20041110.3.rf.i386.rpm Preparing... ########################################### [100%] 1:libpostproc ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/ffmpeg-0.4.9-0.20041110.3.rf.i386.rpm Preparing... ########################################### [100%] 1:ffmpeg ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/ffmpeg-devel-0.4.9-0.20041110.3.rf.i386.rpm Preparing... ########################################### [100%] 1:ffmpeg-devel ########################################### [100%] [root@mayu SRPMS]# rpm -ivh ../RPMS/i386/ffmpeg-debuginfo-0.4.9-0.20041110.3.rf.i386.rpm Preparing... ########################################### [100%] 1:ffmpeg-debuginfo ########################################### [100%] |
mpeg toosインストールログ
インストールしたけど、動画と音声をうまく合成することができなかったのでつかっていません。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
[root@mayu SRPMS]# pwd /usr/src/redhat/SRPMS mjpegtools-1.6.2-1.src.rpm [root@mayu SRPMS]# rpmbuild --recompile mjpegtools-1.6.2-1.src.rpm mjpegtools-1.6.2-1.src.rpm をインストール中 警告: user rbultje does not exist - using root 警告: group rbultje does not exist - using root エラー: Failed build dependencies: libquicktime-devel is needed by mjpegtools-1.6.2-1.i386 nasm is needed by mjpegtools-1.6.2-1.i386 [root@mayu SRPMS]# [root@mayu SRPMS]# rpmbuild --recompile libquicktime-0.9.4-2.rf.src.rpm libquicktime-0.9.4-2.rf.src.rpm をインストール中 警告: user dag does not exist - using root 警告: group dag does not exist - using root エラー: Failed build dependencies: libdv-devel is needed by libquicktime-0.9.4-2.rf.i586 lame-devel is needed by libquicktime-0.9.4-2.rf.i586 libraw1394-devel is needed by libquicktime-0.9.4-2.rf.i586 libavc1394-devel is needed by libquicktime-0.9.4-2.rf.i586 [root@mayu SRPMS]# rpm -qa|egrep libdv libdvdcss-devel-1.2.8-1 libdvdcss-1.2.8-1 libdv-0.103-1 [root@mayu SRPMS]# rpm -qa | egrep lame [root@mayu SRPMS]# rpm -qa | egrep libraw libraw1394-0.10.1-3 < -- IEEE1394に直接アクセスできるらし [root@mayu SRPMS]# [root@mayu SRPMS]# rpm -qa | egrep libavc libavc1394-0.4.1-3 <-- Audio/Video Controlプロトコルを扱うものらし [root@mayu SRPMS]# [root@mayu SRPMS]# yum install libdv-devel [root@mayu SRPMS]# yum install libraw1394-devel [root@mayu SRPMS]# yum install libavc1394-devel [root@mayu i386]# pwd /usr/src/redhat/RPMS/i386 [root@mayu i386]# rpm -ivh lame-3.96.1-2.1.fc3.rf.i386.rpm 警告: lame-3.96.1-2.1.fc3.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 Preparing... ########################################### [100%] 1:lame ########################################### [100%] [root@mayu i386]# rpm -ivh lame-devel-3.96.1-2.1.fc3.rf.i386.rpm 警告: lame-devel-3.96.1-2.1.fc3.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 Preparing... ########################################### [100%] 1:lame-devel ########################################### [100%] [root@mayu SRPMS]# rpmbuild --rebuild libquicktime-0.9.4-2.rf.src.rpm [root@mayu SRPMS]# [root@mayu i586]# pwd /usr/src/redhat/RPMS/i586 [root@mayu i586]# rpm -ivh libquicktime-0.9.4-2.rf.i586.rpm Preparing... ########################################### [100%] 1:libquicktime ########################################### [100%] [root@mayu i586]# [root@mayu i586]# rpm -ivh libquicktime-devel-0.9.4-2.rf.i586.rpm Preparing... ########################################### [100%] 1:libquicktime-devel ########################################### [100%] [root@mayu i586]# Preparing... ########################################### [100%] 1:libquicktime-debuginfo ########################################### [100%] [root@mayu i586]# [root@mayu SRPMS]# yum install nasm [root@mayu SRPMS]# rpmbuild --rebuild mjpegtools-1.6.2-1.src.rpm gcc -mcpu=i686 -march=i686 -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -Wall -Wunused -o .libs/lavplay lavplay.o ../utils/libmjpegutils.a ./.libs/liblavplay.so ./.libs/liblavjpeg.so -L/usr/src/redhat/BUILD/mjpegtools-1.6.2/jpeg-mmx ./.libs/liblavfile.so -L/usr/lib -lquicktime -lz -ljpeg-mmx -L/usr/local/lib -ldv /usr/lib/libglib.so /usr/lib/libSDL.so -lm -ldl -lasound -L/usr/X11R6/lib -lXext -lpthread -lX11 ./.libs/liblavjpeg.so: undefined reference to `fix_n256' ./.libs/liblavjpeg.so: undefined reference to `fixn089n196p029' ./.libs/liblavjpeg.so: undefined reference to `fix_n196' ./.libs/liblavfile.so: undefined reference to `quicktime_read_audio' ./.libs/liblavjpeg.so: undefined reference to `fix_054p076' ./.libs/liblavjpeg.so: undefined reference to `fix_n196_n089' : ./.libs/liblavjpeg.so: undefined reference to `const_0x2xx8' ./.libs/liblavjpeg.so: undefined reference to `fix_n256_n196' ./.libs/liblavjpeg.so: undefined reference to `te1' collect2: ld returned 1 exit status make[2]: *** [lavplay] Error 1 make[2]: Leaving directory `/usr/src/redhat/BUILD/mjpegtools-1.6.2/lavtools' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/redhat/BUILD/mjpegtools-1.6.2' make: *** [all] Error 2 エラー: Bad exit status from /var/tmp/rpm-tmp.46019 (%build) RPM build errors: user rbultje does not exist - using root group rbultje does not exist - using root Bad exit status from /var/tmp/rpm-tmp.46019 (%build) [root@mayu SRPMS]# |
本家からのダウンロードではうまくゆかなかったです。
これが関係あるかも。http://dag.wieers.com/packages/mjpegtools/http://www.mail-archive.com/mjpeg-users@lists.sourceforge.net/msg05121.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
[root@mayu SRPMS]# rpmbuild --rebuild mjpegtools-1.6.2-4.rf.src.rpm : gcc -march=i686 -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -Wall -Wunuse .libs/lav2wav lav2wav.o ../utils/libmjpegutils.a ./.libs/liblavfile.so -L /lib -lquicktime -lz -ldl /usr/lib/libjpeg.so -ldv -lm /usr/lib/libglib.so hread ./.libs/liblavfile.so: undefined reference to `quicktime_read_audio' collect2: ld returned 1 exit status make[2]: *** [lav2wav] Error 1 make[2]: *** Waiting for unfinished jobs.... gcc -march=i686 -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 -Wall -Wunuse .libs/lav2yuv lav2yuv.o lav_common.o ../utils/libmjpegutils.a ./.libs/lib ile.so -L/usr/lib -lquicktime -lz -ldl ./.libs/liblavjpeg.so /usr/lib/libjp o -ldv -lm /usr/lib/libglib.so -lpthread ./.libs/liblavfile.so: undefined reference to `quicktime_read_audio' collect2: ld returned 1 exit status make[2]: *** [lav2yuv] Error 1 make[2]: Leaving directory `/usr/src/redhat/BUILD/mjpegtools-1.6.2/lavtools make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/redhat/BUILD/mjpegtools-1.6.2' make: *** [all] Error 2 エラー: Bad exit status from /var/tmp/rpm-tmp.44251 (%build) RPM build errors: user dag does not exist - using root group dag does not exist - using root user dag does not exist - using root group dag does not exist - using root user dag does not exist - using root group dag does not exist - using root user dag does not exist - using root group dag does not exist - using root Bad exit status from /var/tmp/rpm-tmp.44251 (%build) 結局 http://dag.wieers.com/packages/mjpegtools/ [root@mayu i686]# pwd /usr/src/redhat/RPMS/i686 [root@mayu i686]# rpm -ivh mjpegtools-1.6.2-4.1.fc3.rf.i686.rpm 警告: mjpegtools-1.6.2-4.1.fc3.rf.i686.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6 Preparing... ########################################### [100%] 1:mjpegtools ########################################### [100%] [root@mayu i686]# [t-randt@mayu tmp]$ lav2yuv -A 320:240 +p cimg1154.avi | mpeg2enc -b 7500 -F 5 -f 4 -o cimg1154.m2v |
参考URL
http://www.slit-ray.sccs.chukyo-u.ac.jp/~miyasaka/memo/ieee1394.html