|
At the crossroad of New media, Engineering, Research and Development
|
|
Archive for ‘Linux’ Category
Nov
21
2007
How to live transcode and stream HDV to MP4 using VLC and LinuxI’ve been trying to figure out a way to do this on the cheap for a long time and I finally figured it out today. This process allows you to grab HDV from a HDV Camera via firewire, feed it into linux, transcode the 25Mb/s mpeg-ts stream to a 4 Mb/s mpeg4 stream (inside a TS). This mpeg4 stream in turn can be viewed at full resolution (1920×1080) on a remote client running just vlc. Here is the prerequisites:
Okay so here we go, follow the steps below to get setup:
Now that you have the chain setup, it’s time to do a quick test and see if the system is working. Issue the following command from a xterm, making sure that the camera is turned on and in “Camera” mode.
If this works you should get a vlc window and be able to see live video from your HDV camera. If you didn’t then stop here and make sure you get this working first.
So now that we have dvgrab working, lets grab that 25Mb/s HDV stream and squish it down to 4Mb/s mpeg4 stream using the following command:
So now you should be able to open up vlc on the receiver machine, goto File/Open Network menu and select UDP/RTP and specify port number 1234. Once you press OK, you should see the video stream on your receiver machine. Audio works as well and is perfectly synced since it’s captured by the HDV camera at the source and travels together with the video at all time. The delay is about 3 seconds.
This is a great way to quickly setup a HD Video Conference between a couple of locations. You could even modify the network portion of the chain to let VLC multicast the HD stream onto your network…..lots of possibilities. Enjoy
Nov
01
2007
Getting Samba to work properly with SuSE’s Firewall…Here we are again and I have to sadly say…..yet another OS (which I also love) that does not do what it promises. I know that you can do some major iptables kungfu under linux through command line, but when SuSE/Novell tries to sell you Yast as a graphical admin interface they should atleast check to make sure things are working properly. Samba works under SuSE 10.x, and even with the firewall turned on the machine can act as a member of a Windows domain/workgroup. The problem though, is not with using Samba and having the firewall turned on. The problem is having Samba do more than just act as a member of the domain. We have a SuSE 10.1 machine that is part of our AD domain (spanning 3 subnets) and we also like it to be our local master and preferred master on the local subnet. It has one NIC active (ie: direct connection, with no NAT) and iptables firewall is active on that NIC. The problem is that the firewall rules that Yast2 creates are too restrictive (ie: if you just go to Yast2 and add Samba services as a allowed service).
Here is how you can fix this with a bit more effort:
Now you’ve got the right holes punched through the firewall so click Finish and enjoy. You can now go back to the Samba config and make changes to become a serving member of your domain/workgroup.
Oct
24
2007
OSX Webmaster special: Shared webserver, bad umask settings, group permissions and filenames with spaces…Okay so this all started with our users not being able to share files on our webserver. We use SSH only for upload/download and interactive access (ie: no ftp). Through trial and error we found out that the default umask (under OSX Server) for sftp uploaded files are 0033 (ie: rwxr–r–) and directories are 0022 (ie: rwxr-xr-x). This creates a problem when one user uploads a file and another user downloads/modifies and tries to re-upload it — they simply can’t because the group permissions are wrong. If we were using ftp (which we are not) there are some solutions on the net that allow you to modify the startup parameters for the ftp server so that the default umask for all files is 0013 — which would allow a group of people to share/overwrite each others files — but we are using ssh only. So we came up with two other solutions — a shared upload account and/or a cron job that would modify the group permissions on the website directory to allow group sharing. We went with the second solution and that’s where I ran into so many problems that I decided to create this post. You see normally Unix users know that spaces (and strange characters) in filenames are a no-no. Well that’s not true for Windows and Mac users, they use spaces and other odd characters in their filenames/folders all the time. I started writing — what I thought was — a simple “for loop” script to go through the website folder and change the group permissions. Of course on the first try things didn’t work nicely because of spaces, so I started compensating for that and came up with: Finally after a latenight RTFM session (and lots of cursing), I think I’ve found the ultimate file handling loop statement: After trimming and optimizing the script a bit, here is the final product: Well, I’ll leave this one to you. You can decide on it’s Kosherness. The application is called TED and it can find all sorts of TV episodes you might have missed. From the homepage: ted can find episodes of any TV show you like to watch. Just add your favorite shows to ted and he will search for the newest episodes and downloads them for you. ted uses bittorrent and RSS technology to get you the newest episodes as fast as possible! ted comes with a huge list of shows, all waiting for you to be watched. ted even displays a summary of each show, to help you choose shows you like. ted requires Java 5 and a bittorrent client and is available for all platforms (Linux, Windows, Mac). Download here. You all know my dislike for Microsoft and their products. Whenever possible I’ve tried to get away from having to use their software. Here is another opensource product that allows us to do our thing without them. From their overview page: OpenProj is a free, open source desktop alternative to Microsoft Project. The OpenProj solution is ideal for desktop project Click to enlarge in a new windowmanagement and is available on Linux, Unix, Mac or Windows. OpenProj is a complete desktop replacement of Microsoft Project and even opens existing native Project files. OpenProj shares the most advanced scheduling engine in the industry with Project-ON-Demand. The OpenProj solution has Gantt Charts, Network Diagrams (PERT Charts), WBS and RBS charts, Earned Value costing and more. You can get more detailed information on OpenProj or download now! Jul
30
2007
iPhone keyboard done better on Nokia N800….Well they said it can’t be done. They said the secret of the apple sauce was only known to Steve. Looks like Gustavo Sverzut Barbieri has it figured out. 1340 lines of code and you’ve got the Apple’s Ubercool keyboard on the N800…..gotta love open platforms. Jul
19
2007
Get down and dirty with Gumstix Goliath…We’ve been covering quite a bit of Opensource/Linux/Hack-your-own GSM phones (some even with GPS), but here is the ultimate phone for the N.E.R.D’s out there….From the Press Release: “Portola Valley, Calif., July 10, 2007 – Gumstix, Inc, today announced its integrated, open source cellular communications platform: the GoliathTM line of expansion boards. The Goliath-vx board provides GPRS/EDGE function while the Goliath-GPS-vx board combines GPRS/EDGE and GPS. Each Goliath board attaches to a gumstixTM motherboard (verdex only) using a 60-pin connector and includes audio, LCD, touch screen, USB host, 3D-accelerometer, and battery management. General availability is planned for late July and the company will begin taking pre-orders at gumstix.com starting on 16 July. The Goliath boards are by far the largest gumstix products at 105.5mm x 67.3mm, the same dimensions as the Samsung 4.3” LCD touch screens that Gumstix will also sell. Goliath gives verdex motherboards full-speed USB access to the Siemens MC75 GPRS/EDGE module, the u-blox NEO-4S GPS module, and one external USB device.” For those of you who don’t know, Gumstix has been manufacturing a couple of different embedded platforms around the XScale processor family. Their boards runs an opensource embedded Linux exclusively. Recently they have branched out into building lots of expansion boards. These expansion boards when combined with their motherboards can truly allow you to create just about anything. Sounds like you’ve got everything you need to build the “real” Iphone Right on the heels of our story on reconstructor, a tool that allows you to create custom Ubuntu distribution CD’s, here is APTonCD for Ubuntu. It’s basically a graphical tool that allows you to create a CD of all the applications you’ve installed on your Ubuntu system since you installed the system initially. This used to be a pain, if you had to take care of a lab of machines. The drill was: install the OS, add all the required software and then created a master image, followed by multiple image installs. Well thanks to APTonCD you don’t have to do this anymore. You can install the base CD/DVD (or make your own using reconstructor), add all the extra software from the repositories and then run APTonCD. At which point you can instruct it to create a CD/DVD of all the extra packages you’ve installed. The application can also create a CD/DVD of all the software on a specific repository or download all official Ubuntu repositories onto removable media. Very handy if you’re doing a install without net connection. One more thing you can do with this is to get all the Ubuntu official updates/patches/fixes on a CD/DVD, so that you download them only once (if you’re installing mutiple machines). As usual the install is a simple one-liner: sudo apt-get install aptoncd
May
30
2007
Screencasts of Installing MythTV Via MythDora 4.0MythDora 4.0–Fedora Core 6.0 plus MythTV costumizations–is out. It is designed to format your hard drive and install everything needed for a fully functional MythTV System. MythPVR.com has created a three-part screencast of the installation process covering MythDora installation, configuration, and MythTV setup. Using hdhomerun_config command you issue the following (after tuning into the channel ofcourse): 1) hdhomerun_config set /tuner0/target none MCast Address is in range of: 224.0.0.0 –> 239.255.255.255 May
28
2007
HDHomeRun: Monitoring Signal Strength from command lineThe Windows GUI version of hdhomerun_config will display the signal strength and signal quality updating every second. Under linux or osx you can use “watch” with hdhomerun_config: (If you have more than one HDHomeRun then specify the device ID rather than FFFFFFFF) May
28
2007
HDHomeRun: Linux/OSX command line reference for hdhomerun_configYou use hdhomerun_config to manually configure HDHomeRun to stream video to a PC running VLC… You will need: VLC – http://www.videolan.org/vlc/ 1) Discover HDHomeRun Run “hdhomerun_config discover” to find the HDHomeRun units on the local network. If you have more than one HDHomeRun on your network then replace the wildcard FFFFFFFF Device ID in the examples with the Device ID of the HDHomeRun you wish to control. 2) Run a channel scan hdhomerun_config FFFFFFFF scan /tuner0 3) Set the channel Antenna: Note that the channel is the physical ATSC channel, not the channel advertised by the TV station. Antennaweb.org is a good site for determining which stations are nearby and what physical channels they operate on: http://www.antennaweb.org/aw/Address.aspx Check the signal strength using the following command: 4) Select the program number hdhomerun_config FFFFFFFF get /tuner0/streaminfo hdhomerun_config FFFFFFFF set /tuner0/program 5) Launch VLC and open network stream From the GUI: 6) Set the target for the video stream hdhomerun_config FFFFFFFF set /tuner0/target Note that the target setting is automatically cleared if the target machine is not listening on the specified port. ie if VLC is not running or you quit VLC. Troubleshooting Check the signal strength using the following command: Check the target using the following command: If it reports “none” then most likely the pc was not listening on the target port and the ip/port was automatically cleared. Double check the following and then set the target again: If the target is correct and the LED on the HDHomeRun indicates it is streaming video then the most likely problem is a firewall blocking the port (UDP port 1234 used in this example). |