Showing posts with label MediaGate. Show all posts
Showing posts with label MediaGate. Show all posts

Monday, January 12, 2009

Water, a new Canon 5D video

After a couple of weeks of gathering content, I completed my first real Cinelerra project using the 1080P output from my brand new Canon EOS 5D Mark II.

This camera outputs some gorgeous video as I showed in my last post. Now I have to learn how to shoot with it!

The Project
My goal with this short production was:
1) to show the capabilities of the camera
2) to prove that Cinelerra was up to the task of editing 1080P content
3) to output the final results to different output formats (media player, Vimeo, back into Cinelerra)

I'm a hobbyist, so I don't have a budget and "script" like Vincent Laforet. However, I like to compile scenes and organize them with musical accompaniment in thoughtful ways that are (hopefully) enjoyable to the viewer.

The Images
Since I am not a professional photographer, I did not have a slew of lenses before I bought the cam. I only used two lenses that I recently bought for this video:
Canon EF 24-105mm f/4 L IS USM Lens
Canon EF 50mm f1.4 USM Lens

In regards to the imagery, about half of the shots were taken with a tripod. Where you see shakey video is obviously where I held the cam by hand. You definetly do NOT want to shoot high definition video by hand. It serves to amplify any wobbling present and looks terrible when presented on a high definition television. One thing that saved me was the stabilization provided by the Canon L series zoom lens. It is very effective in dampening bounces, though the stabilization mechanism is loud and is picked up by the camera's poor quality, but usable internal stereo microphone.

I used the 50mm mainly for the indoor shots and the zoom for the outdoor shots. I shot some of the outdoor night shots with the zoom, but then realized that the zoom doesn't do well in low light conditions since it has such a long zoom barrel. So just last week, I bought the 50mm. The 50mm fixed length (prime) lens really makes night shots clear with none of the spotty, dappled artifacts that you see with high ISO night shots. During the video, you'll notice those artifacts on the shot of the ferry.

Note that I used no filters on the shots..what you see in the video is truly what you get with the camera. As I gain expertise with the camera, I look forward to acquiring lenses over the next few years.

The Editing Process
The editing process has been a bit of a challenge, as the native output from the camera does not import cleanly into Cinelerra. Hence, I needed to transcode the native output into something more Cinelerra friendly, which I discuss in earlier posts:
/2009/01/first-edit-canon-5d-mark-ii.html
/2008/11/playing-tokyo-reality-in-1080p.html

I didn't want to revisit the conversion process, so I opted to use the MJPEG conversion command I previously discovered:
ffmpeg -i input.mov -b 3000k -vcodec mjpeg -ab 256k -ar 44100 -acodec libfaac -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 output.mov

Once loaded in Cinelerra, I found I had quite a few assets from the last couple weeks of shooting.



If I could have one improvement made to the software, it would be to add folders to the Media bin in order to better manage assets.

I went about editing the video as normal. I applied only time-based effects, like speeding up or slowing down the video, and transitions. The time-based effects were accomplished by attaching the ReframeRT video effect:


Output
I needed to output files from the project for different purposes:
1) to reimport back into Cinelerra (JPEG or MJPEG Quicktime video)
2) to export/render a format usable with my MG-350HD Media Player
(1080I/1080P MPEG2 video)
3) to export/render a format usable for Vimeo (720P MPEG2)

For #1, I exported a Quicktime for Linux container, using MJPEG compression. I just needed the video, so I had no audio on the export. I was able to reimport the resulting file easily into Cinelerra.

For #2, I rendered the video using a YUV4MPEG pipe. I needed to adjust the pipe command to export a different format and higher video bitrate.
mpeg2enc --verbose 0 --aspect 3 --format 13 --frame-rate 4 --video-bitrate 24000 --nonvideo-bitrate 384 --interlace-mode 0 --force-b-b-p --video-buffer 448 --video-norm n --keep-hf --no-constraints --sequence-header-every-gop --min-gop-size 6 --max-gop-size 6 -o %

Using mplex, I then combined the video stream with an existing audio track to an MPEG2 Program Stream:
mplex -f 3 -b 2000 canon5d.m2a canon5d.m2v -o canon5d.ps

Finally, I converted the program stream to an MPEG2 Transport Stream using vlc:
cvlc canon5d.ps --sout '#duplicate{dst=std{access=file,mux=ts,dst="canon5d.m2t"}}' vlc:quit

For #3, I reduced the 1080i/p output to 720P using FFMPEG:
ffmpeg -i canon5d.m2t -target ntsc-dvd -s 1280x720 -qscale 1 -threads 8 canon5d.mpg

Update 2008/01/13
I hadn't noticed before, but after I uploaded the 720P file to Vimeo, there was a little bit of a line on the bottom of the video. I am going to have to revisit the edit to make sure I didn't mess something up.
*** end update ***

I think the quality of the output can definitely be improved. However, I am glad that I was able to output to formats usable across different platforms (HDTV/Internet/Linux-Cinelerra).

Update 2008/02/08
I've been working on improving the quality of the output from Cinelerra. Specifically, instead of using MJPEG source files (the first conversion from the cam), I'm converting the Canon's video to MPEG2-TS. The MPEG2-TS format has very nice quality and edits quickly in Cinelerra. Here's the full skinny:
/2009/02/dark-of-winter-has-me-in-its-grasp.html
*** end update ***

In Sum
Dealing with a new media format in Linux and Cinelerra is never easy. But if you have patience, it is very satisfying to get a project done that makes your friends say "Wow" or have a laugh.

the mule

Sunday, November 16, 2008

playing Tokyo Reality in 1080p

The guys at Akihabara News got their hands on a Canon EOS 5D Mark II and produced some beautiful (though shakey) video while running and gunning around Tokyo:


The video is on Vimeo, but the guys kindly also made the 1080p source available here. I downloaded the gigantic 1.8GB Torrent from here. That is 1.8GB for six minutes and ten seconds of video. Wow!

Linux Playback
I wanted to see which media players could handle such a large file. Here were my results on my Fedora 7 x86-64 system:
- dual quad core, 1.6Ghz
- 2GB
- NVidia 8800GT dual head system with twin Dell FP1905 monitors

mplayer played the file cleanly if the application window was stretched to a max of about 1400 pixels wide. Any wider, and mplayer would stutter.

xine couldn't play the file as it seems I do not have the correct codec installed. I got the dreaded "file uses an unsupported codec" error:


ffplay played it with slight audio stutters and the following error:
[mpeg4aac @ 0x3947e23ca0]faac: frame decoding failed: Gain control not yet implemented

I will have to investigate this.

Update 2008/11/23
Reviewing Google for this error, most of the suggestions for fixing the problem state that you should have the latest version of faad2/faac. According to the developer at www.audiocoding.com, I do:
faac x86_64 1.26-3.fc9 installed 182 k
faac-devel x86_64 1.26-3.fc9 installed 49 k
faad2 x86_64 1:2.6.1-10.fc9 installed 344 k
faad2-devel x86_64 1:2.6.1-10.fc9 installed 414 k


So, I'm at a loss why these messages are occurring.
end update

I converted Tokyo Reality using mjpeg as the video compression method:
ffmpeg -i Tokyo-Reality-h264-1080p.mp4 -b 3000k -vcodec mjpeg -ab 256k -ar 44100 -acodec mpeg4aac -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me hex -subq 5 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 tokyo.mp4

On my Dell SC1430, 1.6Ghz with eight cores, the conversion took about the same time as the file was long, about 6 minutes, 10 seconds. The size of the original was 1.8GB; the size of the conversion was 1.6GB. Not much difference there.

Update 2008/11/22
I compared the output of the original to the output of the MJPEG conversion. On the left of the below screengrab is the original from Akihabara. On the right is my conversion. You'll notice that the converted image on the right is slightly more saturated than the one on the left. I'll have to play with the conversion parameters to get the colors a little more like the original.

end update

When I replayed this video, within about four minutes, I exhausted 2GB of RAM and 4GB of swap. Holy crap! The normal Cinelerra editing functions (cutting/pasting) did not exacerbate this memory issue. Only the replay function seemed to suck up all my memory:


The replay was a little choppy at the beginning, but ran at 30fps. However, as RAM filled up, playback performance dropped to 12fps, as RAM was exhausted and swap was being utilized. Once swap was exhausted, the entire box locked up! Scary!!

Update 2008/11/17
I had been planning on upgrading my system to Fedora 9 and the above memory leak was enough for me to say "fuck it" and just do the upgrade. Upgrades are increasingly complex as I've added four RAID drives to my setup. Well, just when you think it is going to be a nightmare, along comes Fedora and actually made the process pretty seemless. Within two hours, I had Fedora 9 installed, all my Cinelerra source dependencies installed, Cinelerra compiled and up and running. Of course, this is from a guy who has been doing this for how many years now? But still..two hours..I hardly believe it myself.

The icing on the cake is that my memory leak is no longer present! The below chart show CPU utilization and memory while the video plays:


So far, the system is much more responsive than the old Fedora 7, 64-bit. I guess I had some old/outdated/corrupted libraries in there. Now playback of Tokyo Reality in Cinelerra is more consistent, albeit at a slower 19fps.
end update

MacBook Pro Playback
I next copied the file to my 2GB, dual core Intel 2.2Ghz MacBook Pro 17". I attached my 42inch display to the second head on the MacBook's video card. The file played in QuickTime. It played without errors when I manually enlarged the Quicktime window to fill the screen; however, QuickTime stuttered when the video was maximized to Full Screen using the 42" monitor as the output display.

Finally, I tried to play the file on my MediaGate to absolutely no avail.

So, it looks like the only reliable players are mplayer on Fedora 7 and QuickTime on my MacBook Pro.

I think I need to upgrade my Fedora 7 system to a newer OS. Hopefully, a more recent OS and supporting encoders/decoders will do a better job of playing these large files back.

The Mule

Monday, January 14, 2008

MediaGate MG350HD v1.1.7 firmware

For my MediaGate MG350HD wired and wireless media player:
http://www.mediagateusa.com/html/mg350.html

I upgraded to the latest MediaGate firmware version 1.1.7. The previous version I was using was 1.1.1beta. With that version, I had been experiencing poor playback of HDV MPEG-TS videos. The video would stutter and the audio would drop out. I downloaded the upgrade from here:
http://www.mediagateusa.com/html/download/download.html

MediaGate firmware upgrades are always a pain in the ass because when the new firmware is written to the device, the configuration of the device gets reset and you need to re-enter all your configuration information. Most painful is entering the wireless security information. A long WEP key password is particularly painful because you have to enter the 20+ alphanumeric key using the remote. And, the video output settings are similarly reset, so instead of viewing the menus in HD, I have to use the separate composite connection and then reset the output type and resolution to DVI, 1080P. Ugh.

On the brighter side, once I got my wired and wireless network and display settings re-input, I was very pleased to find out that the video freezes and audio drop outs for the HDV MPEG-TS videos had been eliminated! Thanks MediaGate, for fixing those problems!

In addition, the new 1.1.7 firmware has an FTP server, so I no longer have to install the kludgy NDAS drivers.

Setup of an FTP Server with the MediaGate is easy:
  1. Start up your 1.1.7 Mediagate
  2. Press "Setup" on your remote
  3. Navigate to the "FTP Server" section of the setup
  4. Enable the FTP server
  5. If you wish to change the username and password, do so here
  6. Save your settings
  7. Verify the MediaGate is on your network. Use "ping [IP address of the MediaGate]" either wired or wirelessly) to make sure the device is on the network
  8. Test FTP access by logging in from another machine on your network. From the command line, this would entail a command such as "ftp [IP address of the MediaGate]".
  9. If you get a connection via the above command, enter your username and password. You should be good to go!
So I can now upload files directly to the MediaGate via good old FTP! Nice job, MediaGate!

One suggestion for the MediaGate people is to create a firmware upgrade that does not wipe out my configuration information. That would be greatly appreciated.
:)

Sunday, February 11, 2007

MediaGate - Ximeta NDAS troubles with Linux

The MediaGate MG-350HD is a little wireless device that allows me to view my Cinelerra creations on my HDTV.


So, I'm trying to get it to work smoothly with Linux, as that's where my HD source files are. However, HD files will only play on the MediaGate if the files are either:
1) accessed via network share over wired connection or
2) copied via NDAS drivers to the hard drive installed in the thing

Ximeta (http://www.ximeta.com/) are the makers of the network direct attached storage (NDAS) that the MediaGate uses. I don't have a hard run down to my entertainment center, so I've been pulling my hair out in order to get the NDAS drivers working. The problem with this is that the drivers seem to work on XP only. The Linux drivers on Ximeta's site don't work worth a damn. They fail on my fedora and redhat enterprise boxes and on the two Ubuntu installs (6.0.6/6.1.0) that I did this morning. Yarg. In addition, I've tried upgrading the firmware to no avail. The frustrating thing is that the firmware is supposed to fix a problem where the MG can't do wired and wireless connections at the same time. In point of fact, the firmware upgrade has BROKEN wireless. Double YARG!!

2/11 Update: I've since fixed the wireless by first doing an AP (access point) scan of the enviroment first, and then changing the wireless mode to Ad Hoc to configure the security settings of my specific router. Gads!

So I think I'm just going to leave it wired upstairs for now, copy over the HD content when its ready and bring it back down to the HDTV. What a waste of time..I'm going to send the bozos an email.

2/19/2007 Update: A wirelessly mounted MediaGate is now working!!

Wednesday, January 03, 2007

MediaGate MG-350HD review

Happy New Year folks! I thought I'd take a break from the usual Cinelerra-HDV talk to discuss a new toy I got for Christmas: the MediaGate MG-350HD.


Since I am in a band and am its archivist, I have a lot of audio and video files that I've created over the years. So I wanted to get a device that would playback the high-definition videos and audio I've recorded on my home theater. The MediaGate MG-350HD seemed to fit the bill as an all-in-one media player: it plays video and audio files of almost any type (no Quicktimes, though) streamed from one or more network shares via wired or wireless ethernet connection. It also plays files from an attached USB drive or hard drive you supply and can act as a network storage device. In practice, the device works well enough with its bare bones setup and media selection/playback interfaces, but needs more setup and careful installation than the shiny brochure would have you believe.

I will tailor the following discussion to technically inclined individuals who will read the MGs' manual or search google for reviews and information that has already been discussed. You can get the manual and firmware upgrades online from http://www.airlinktek.com/ in the Support section. I will highlight the time consuming points for me or information about the device that is lacking in the online resources. It is best if one reads the manual first. Though the supplied manual has enough information to get the device setup and working, it is poorly written by a non-native english speaker.

For those who don't like reading manuals, my suggestion would be to simply hook it up to your TV using any of the provided composite, svideo, component or DVI connections, turn it on and press "setup" on the remote. If you don't have a picture on the TV immediately, select an alternate video mode by pressing the "TV out" button multiple times to cycle through the different options. With the remote, you control all the device configuration and media playback functions of the MediaGate.

After opening the box, I decided to configure the device in logical fashion by trying out the simpler functions and then advance to the more complicated setups:
- attach a USB drive and play files from it
* USB setup was easy and playback worked using my Corsair Voyager 2GB USB drive, though you cannot copy files to the USB drive.
- install a hard drive into the unit and play files from it
* Drive setup was also easy using an 80GB drive I had lying around and playback worked using the provided USB cable.
- connect it to my network via wired LAN connection
* Wired setup worked using DHCP after some fiddling.
- copy files to the internal hard drive using its network attached storage drivers
* works over a proprietary network protocol (NDAS) from Ximeta (http://www.ximeta.com).
* NDAS drivers only work on Windows 98/2000/XP, but there are experimental Linux drivers on their website that I haven't yet tried.
- connect it to my wireless network
* Wireless setup worked using DHCP and access point scan (ad hoc access point attachment is also available)
* laborious WEP key input using the remote
- stream files from my main server to the MediaGate
* tricky Windows share setup was the source of a couple hours of frustration
* streaming high def content only worked using internal disk or wired connection
* dvd and lower resolution content can be streamed using wireless

Speaking of playback, here are the file formats that the MG 350HD played for me:
- DVD format MPEGs (720x480 MPEG2s with 16 bit, 48Khz stereo or MPEG1 audio) and their individual, demuxed audio/video streams
- VOB files
- DIVX
- MPEG2 TS (transport stream) HD files (720p)
- AVIs
- PNGs/JPGs
- MP3s/WAVs/WMAs/OGGs
- MPEG4s created by iTunes

It doesn't play:
- Quicktime videos
- WMVs (I need to test this more)
- Ogg/Theora videos

This is not an exhaustive list, but at least will give you an idea of file compatibility. Playlists of videos and music can be created from any of the attached devices and played back in order or shuffled. The interface to sort through your media and create playlists is basic at best and no where near as slick or as easy as an iPod. Since the interface is where you will be spending quite a bit of time, it is also unfortunate to note that it is not customizable or skinnable. Firmware updates come once per quarter or less frequently, so there will be a long wait for any enhancements to the interface.

SMB shares from Windows 2000 were easily recognized. For XP, you need an account named "guest", "media" or "administrator" with a blank password. This obviously creates a security hole. Also, I needed to assign Read privileges to the XP Guest account for the directories I wanted to share.

The most pain I experienced in the share setup was getting the device to recognize the SMB share I created on my Fedora Linux box. Lots of issues with this one:
- proper user authentication
* you need to use either an account named "guest", "media" or "administrator" with a blank password. Security hole on the systems with the shares
- lowering SELinux lockdowns for SAMBA
* select all options under SAMBA in the SELinux config utility
- appropriate file privileges
* chmod 755 on any files you want to play
- change the default SMB security level
* use a security level of "share" in the /etc/samba/smb.conf file

I had no trouble streaming high definition content from a network share using a wired connection. Using wireless I was only able to stream DVD resolution files (including MPGs and DIVx) as well as any music files without dropouts. Over wireless, strong signal strength is a must for playing back DVD resolution files without dropouts. If you're not playing back any files, the "info" button on the remote will show you the wireless signal strength. While playing back files, "info" will show you the specifications of the file being played back. Many of the buttons on the remote serve double duty depending on if you are in setup versus playback mode.

In sum, the MediaGate MG-350HD met my expectations and can playback an impressive array of video and audio files. The interface needs a -face lift, but the unit does a yeoman's job of serving up content. Definetly, you will need a wired connection or copy any high def media you have to an internal hard drive in order to view those on your HDTV via the MediaGate. Nice product.