Tutorial on
How to create video for the Sansa Fuze without using SMC.
(version 1.1)
Contents:
-
Fuze video format specifications
-
Video Processing on Linux
-
Video Processing on Windows
-
Alternatives
-
Conclusion
1. Fuze video format specifications
Video
- codecs: according to the MPEG-4 Part 2 (Visual) Standard ( required ), e.g. ffmpeg’s mpeg4, Xvid and possibly others
- video frame size: 224x176 pixel ( required )
- frame rate: 20 fps ( required )
- video keyframe interval: 15 frames
- video bit rate: 500-700 kbps
- non-interlaced, non-anamorphic
Audio
- codecs: constant bitrate MPEG-1 Part 3 Layer 3, known as MP3 ( required )
- audio channels: 2 that is to say stereo ( required )
- audio sampling rate: 44100 Hz ( required )
- audio bitrate: 128 kbps
AVI Container
- OpenDML index: standard indexes every 4000 video frames ( required )
- Audio alignment: align on interleaves ( required )
- Interleave interval: every 2 video frames
- legacy index is beeing ignored by the Fuze
- RIFF-AVIX extensions are ignored too
2. Video processing on Linux
Let me start with some Linux related instructions because linux folks did not yet have any chance to use videos on their Fuze. This was the main motivation for me to find an alternative to the Sansa Media Converter windows software.
2.1 Software requirements
The following instructions are somewhat Debian - centric because that is the system I run with. Anyway, users of other Linux distributions should not have problems to translate them.
I prefer the mencoder software for the video conversion part but there are certainly other possible solutions to reach the goals.
Add the following package repository to your /etc/apt/sources.list file:
deb http://www.debian-multimedia.org lenny main
Install packages by
apt-get update
apt-get install mencoder wine ttf-mscorefonts-installer
If you never used it before you might want to configure your wine settings by
running
winecfg
Get the AVI-Mux GUI windows software. Create a directory under your wine program folder (note that I run a german desktop) and unpack the software, e.g.
mkdir ~/.wine/drive_c/Programme/avimux
cd ~/.wine/drive_c/Programme/avimux
unzip <path_to>/AVI-Mux_GUI-1.17.8.zip # MUST replace <path_to>!
2.2 Basic Step-by-step Procedure
Although there exist an easy to use shell script (see 2.3 below) to achieve both video conversion and AVI remuxing by a single shot I’d like to show the underlying steps first. You can savely skip this chapter if you like to go on quickly.
2.2.1 Video Conversion
I have choosen to run a 2-pass conversion with mencoder. You can simply
run the following looooong commands directly from a Linux shell (bash in my case):
srcvideo=<myvideo> # MUST edit! e.g. “/data/user/myvideo.mkv” or: “dvd://1”
outfile=my.avi # MUST edit!
mencoder -ffourcc DX50 -ofps 20 -vf pp=li,expand=:::::224/176,scale=224:176,harddup </font>
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=650:vmax_b_frames=0:keyint=15:turbo:vpass=1 </font>
-srate 44100 -af resample=44100:0:1,format=s16le -oac mp3lame -lameopts cbr:br=128 </font>
“$srcvideo” -o “$outfile”
mencoder -ffourcc DX50 -ofps 20 -vf pp=li,expand=:::::224/176,scale=224:176,harddup </font>
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=650:vmax_b_frames=0:keyint=15:vpass=2 </font>
-srate 44100 -af resample=44100:0:1,format=s16le -oac mp3lame -lameopts cbr:br=128 </font>
“$srcvideo” -o “$outfile”
If you look at the two menconder commands you will notice that I use the mpeg4 codec from libavcodec library which in turn is part of the ffmpeg project. The Xvid encoder works as well but you need different options (-ovc xvid -xvidencopts …). I’ll skip the full command lines here.
2.2.2 AVI Remuxing
The AVI Container has to be rebuild with some specific settings. I could not find any native Linux software to achieve this. Therefore I have choosen to use the excellent AVI-Mux GUI software under wine. You can run it like this:
WINEPREFIX=“$HOME/.wine” wine “C:\Programme\avimux\AVIMux_GUI.exe” &
You need to adjust some settings. Press the “settings” button. In the “Input/output settings” window press the “AVI file structure” button in the Output button group. Adjust the values to match the following screenshot:
Click “OK” to proceed. This will save the new settings as default for later runs.
Load the video file generated by the video conversion procedure (right mouse click in the “open files” entry widget). You must click on this video file to highlight the entry and now you can press the “generate data source from files” button. Finally you press the “start” button, choose an output file name and let the program finish.
2.3 All-in-One Shell Script
I wrote a little shell script pvc.sh ( P ortable media players V ideo C onverter) to ease video processing in particular for the SanDisk Sansa Fuze. Download link and most up-to-date information is provided on this post.
Running all the steps described under 2.2 above - including the setup of AVI-Mux GUI options and executing under wine - is as simple as running the command
pvc.sh sourcevideo.mpeg fuzevideo.avi
2.4 Copy video to Fuze
Well, that is simple. Connect your Fuze in MSC mode to the computer. Drag and drop the processed and remuxed video file into the VIDEO folder on internal storage or SDHC card.
You don’t need a .thm file which is nothing else but a JPEG image to serve as a thumbnail.
Disconnect your Fuze, wait for database refresh and ENJOY !
3. Video processing on Windows
3.1 Software requirements
Obviously you need a video conversion software. You could install the windows executable of MEncoder and run it from command line but most users would prefer a comfortable GUI application. I recommend the free MediaCoder which is a nice GUI around many open source projects applications, including mencoder, ffmpeg, xvid and many others. It runs on Linux boxes under wine too.
The second part of required software is the AVI-Mux GUI. Get it from the given site and extract/install it.
3.2 Video Conversion
The specific settings for MediaCoder can be saved in preset files. For the Fuze you can add the following code to a new file called Fuze.xml into the MediaCoder directory tree (…\Programme\MediaCoder\Presets\Video or similar folder name)
\<?xml version="1.0" encoding="iso8859-1"?\>
\<MediaCoderPrefs\>
\<node key="overall.ui.optionTab"\>5\</node\>
\<node key="overall.video.mode"\>Two-Pass\</node\>
\<node key="overall.video.bitrate"\>650\</node\>
\<node key="overall.video.format"\>MPEG4\</node\>
\<node key="overall.container.format"\>AVI\</node\>
\<node key="audiofilter.resample.samplerate"\>44100\</node\>
\<node key="videofilter.scale.enabled"\>true\</node\>
\<node key="videofilter.scale.width"\>224\</node\>
\<node key="videofilter.scale.height"\>176\</node\>
\<node key="videofilter.frame.enabled"\>true\</node\>
\<node key="videofilter.frame.fps"\>20\</node\>
\</MediaCoderPrefs\>
Simply start MediaCoder, choose the Fuze’s presets (menu File/Load Preset), load your video file and convert it.
Small bug I notized with MediaCoder 0.7.1.4490 (at least under wine in Linux): The Summary tab contents does not alway update. If you encounter the same oddity then change to another tab and back to Summary and everything is fine.
3.3 AVI Remuxing
Run AVI-Mux GUI with the settings as described above (see screenshot provided in 2.2.2).
3.4 Copy video to Fuze
See above (2.4).
4. Alternatives
Certainly there exist alternative solutions which you could try out, e.g. look at this thread about video4fuze for a cross-platform GUI approach.
5. Conclusion
With the given example procedures it should hopefully be easy for the average user to accomplish video conversion for the Fuze without a need for the Sansa Media Converter.
The results are quite usable by now. I know there is still room for video quality improvements but I consider this mostly off-topic and you should better consult a specialized video forum for help and discussion.
Any feedback is very welcome!
Good luck and ENJOY your Fuze!
ChangeLog:
version 1.1
- added info about new shell script solution on Linux
Message Edited by ewelot on 08-25-2009 09:28 PM
Message Edited by ewelot on 08-25-2009 10:19 PM