Archive

Posts Tagged ‘firewire’

ffmpeg live stream to ffserver

March 23rd, 2009 Arthur Gressick 5 comments

I finally got this to work!! Here is how I did it.

Hardware: HP a1140n with firewire 6-pin and Canon zr45 with 4-pin firewire. I have everything hooked up and running Ubuntu 8.10.

Software: ffmpeg [http://www.mygeekproject.com/?p=163], ffserver config file [http://www.mygeekproject.com/?p=420, dvconnect [http://www.mygeekproject.com/?p=409, DV Live capture instructions [http://www.mygeekproject.com/?p=433

Once you have everything in place and you tested the live capture of the video then you can continue. Remember that you need to either have a tape playing in the camera or have the camera turned on to start recording for dvconnect to work. I ran through all of the examples first and made sure I could grab the video, transcode the videos to flash before I got this all to work properly.

ffserver.conf [CHANGES]:

Note that you may experience problem with the config file and the output, fear not we will get through this. I commented out the MPG streaming and will eventually give you a great mp4 config as I am still working on it. Below is the FLV code I got working and you can change the information as you see fit for the bit rates etc. Again I commented out all of the mpg stuff in the conf file.

# FLV streaming
 
<Stream output.flv>
Feed feed1.ffm
VideoBitRate 1024
VideoBufferSize 128
Format flv
VideoSize 352x288
VideoFrameRate 24
VideoQMin  3
VideoQMax  3
</Stream>

You can add it right after the sample scripts that is where I added it. In terminal start up the ffserver under root:

ffserver

Now for the following terminal scripts I opened 2 windows and logged in as root [su]

Terminal Window (1) – dvconnect (You should have followed the direction above and tested this already)

dvconnect -- >/tmp/fifo.rawdv

NOTE: it looks like the terminal window has been stuck but it is not, it is waiting on the video stream. Might want to have the video camera on or video running before you issue this command. Trial and error.

Terminal Window (2) – Sending the video to ffserver

ffmpeg -f dv -i /tmp/fifo.rawdv http://localhost:8090/feed1.ffm

NOTE: if you have problem with this command then either the video is not running or something weird might have happened, look at the terminal window (1) and see if it kicked out, it has to be running in order to capture the video to FIFO.

Now with your browser you should be able to see if everything is running from ffserver http://localhost:8090/stat.html. From this page you should see that a stream is waiting on someone to connect.

Watching the video from FLV in a website. I suggest you get the flowplayer from http://www.flowplayer.org. It is the best in my opinion. They have a sample page that you can hook up your FLV from this ffserver to the flowplayer and watch the live stream. Good luck.

Ubuntu 8.10 LIVE Firewire 1394 DV capture

March 23rd, 2009 Arthur Gressick No comments

Another post but this one is a bit different, I am capturing LIVE video information from a DV camera over Firewire 1394.

I am using the same equipment which is a HP a1140n with 6-pin firewire in the back connected to a Canon ZR45 video camera.

I installed the same same software from my other post which can be found here: http://www.mygeekproject.com/?p=409

I started the camera up and also begin recording

Then I did the following things in terminal window as root

mkfifo /tmp/fifo.rawdv
dvconnect -- >/tmp/fifo.rawdv

Running the last command will stop the terminal, that is fine because it is running a process. When you stop the camera then it will stop the dvconnect and prompt will return.

I started another terminal window and begin capturing video to flash file using ffmpeg:

ffmpeg -f dv -i /tmp/fifo.rawdv -vcodec flv -b 666k -s 380x286 -ar 22050 -ab 24 -f flv /home/user_name/Desktop/output-file.flv

I then took a look at the video. You can change around the video script for the ffmpeg. I have a few scripts posted for you to try out: http://www.mygeekproject.com/?p=165

Ubuntu 8.10 Firewire 1394 DV capture

March 20th, 2009 Arthur Gressick No comments

I am using an HP A1140n with firewire (6-pin) on the back hooked to a Canon ZR-45 camcorder (4-pin). I saw on the web that there are a lot of problems so I hope that this will go more smoothly having everything in a single place.

I started with a fresh OS with nothing special at all. I did however install ffmpeg since I am going to convert video so you can either skip that section below or go ahead and install it anyways. We use it a lot and I know that it always comes in handy down the line :-)

Before I begin to install ffmpeg I suggest you install some DV codecs and get thing setup. I needed some libraries for DV to ingest I ran the following command:

apt-get install libdv-bin

Then you need to tell ubuntu 8.10 to load the video module when booting.

nano /etc/modules

Add in the “video1394″ to the bottom of the list, here is a complete dump of my file.

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
 
fuse
lp
sbp2
video1394

It is recommended that you reboot so that the system will load everything properly. Once it reboots you can then test out the capture by typing this command:

dvconnect -v myvideo.dv

If everything went well you can then press play on the video camera and it should write a DV file to the folder you typed the command. If you want to convert the video now just use ffmpeg (there are instructions on our site.)

Link to ffmpeg: http://www.mygeekproject.com/?p=163