01-13-2009 11:21 PM - edited 01-13-2009 11:52 PM
After some SERIOUS digging I have the format for the e200v2 player:
224 x 176
Pixel aspect ratio = 1
Display Aspect ratio = 1.273
Bitrate 700k (way to high for this resolution, up to 25 percent file size increase)
No B frames
I frames N=15
MP3 CBR 128/44.1
Split interleaved every 2 frames
Two mono channels
only the ISTF field is filled, InterVideo
Encoding to this format gets a warning from the player to use SMC. Files close to this lock up the player. Side note: found fix for audio sync and format acceptance problems. Feed the files thru WinFF with this as a preset -r 20 -vcodec mpeg4 -vtag DX50 -s 224x176 -aspect 1.273 -b 700k -qmin 3 -qmax 5 -mbd 2 -bf 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -bf 0 -acodec libmp3lame -ar 44100 -ab 128k -ac 2 and avi extension. If it played in VLC it would run thru WinFF and convert in SMC. SMC has its own "private" codecs ( 3G to Divx to Ulead) which explains its inability to convert files I have codecs for.
Digging deep into video encoding I have discovered that the player is maybe looking for a very specific RIFF structure in the avi file. Every file has the exact same header structure when using SMC. I encoded two files with the same settings in a different encoder, the header was different in each file.
Message Edited by themichael on 01-13-2009 11:52 PM
02-04-2009 07:06 AM - edited 02-04-2009 07:08 AM
I think you nailed it. I own a Sansa e260v2. Just when I was ready to quit on videos because of the dreaded sync issues, I stumbled on your post. It looked serious enough, so I tried it with a couple of avi movies.
The first challenge was setting up WinFF with the preset you provided. Click Edit/Presets, enter a name (Sansa), a label (e200v2 AVI), copy the string into the command line and enter "avi" in the extension. Save the preset. Add the source avi in the list of files to convert, select Convert To... the preset name (Sansa) and label (e200v2 AVI), set the output folder and press Convert. Watch the DOS window (ffmpeg) carefully for error messages (see below).
The first movie had a standard 128bit mp3 audio stream. It looked like a very straightforward job, but it wasn't. I first ran it through WinFF. The ffmpeg window was giving messages about "sync errors". I loaded the source in a freeware called AviDemux which warned me right away that the index had to be rebuilt and offered to do it for me. I accepted and saved a corrected copy of the source avi. I ran the corrected source in WinFF and this time, the ffmpeg log was clean. I ran the converted output through SMC and watched portions of the movie on my Sansa. Everything (video, audio, sync) was perfect.
The second movie had an AC3 audio stream (48000 Hz, 192 kb/s). I first tried running it through WinFF but ffmpeg was giving me errors (header and sync messages). So I decided to first convert the ac3 stream to a standard 128bit mp3 stream and remux it into the avi container. This is how I did it:
1. With virtualdubmod: Demux ac3 audio stream.
In the last step, it was important to uncheck the B-VOPs box in the xvid configuration to eliminate some ffmpeg messages about "vfw-avi packed b frames". I ran this corrected avi source through WinFF with my Sansa preset. The ffmpeg log was clean. I ran the converted output through SMC and watched portions of the movie on my Sansa. Everything (video, audio, sync) was perfect.
There may be a more direct route, but this one works. I should also mention that I used G-Spot a few times to find out exactly what was in the work-in-progress avi, understand the messages given by ffmpeg and figure out the next step. The obvious conclusion is that this is far from straightforward and may be above the capabilities of the vast majority of Sansa v2 owners. Once you're setup with the required software (winFF, avidemux, virtualdubmod, headac3he, syncview, lame, g-spot), knowing a consistently good procedure is half the work.
Message Edited by ArsenoLupino on 02-04-2009 07:08 AM
02-04-2009 08:48 AM
I just wanted to report that I've just completed a third project. This time, it was extremely straightforward. Like the first movie, the audio stream was 48000 Hz 128 bit/s mp3. ffmpeg did not report any errors. I just ran its output through SMC and everything was fine on my Sansa e260v2.
I'm reading more on ffmpeg and it might be possible to optionally expand the WinFF preset command line (and save as additional presets) to correct the types of issues I faced in my first two projects. More later if I'm successful doing this.
02-04-2009 04:29 PM
I found a "shortcut" that can save a lot of time with "difficult" conversions. I redid my second test movie, the one with the ac3 audio stream. I loaded the source directly into WinFF. I created a new preset with exactly the same line suggested by themichael, but I added "-async 1" at the end. As per the documentation, this option tells ffmpeg to "stretch/squeeze" the audio stream to match the timestamps. The parameter is the maximum samples per second by which the audio is changed. -async 1 is a special case where only the start of the audio stream is corrected without any later correction.
As expected, when I ran my avi through WinFF with this preset, ffmpeg gave a lot of errors but it completed the job. I ran the output through SMC. The result is that the video and audio streams are in sync.The only minor problem is that the audio has minor glitches: once or twice per minute, you hear a very short "missing sound". This imperfection is very tolerable in my opinion (much more so than the out of sync audio I've been trying to resolve since I acquired my e260v2.) In my first post above, I gave a procedure to get perfect audio, but it is a lot more work than the shortcut I just described.
A final word on the "-async 1" option. If you find that your audio is a bit out of sync, you might want to create another preset with "-async 2" instead and rerun your conversion in WinFF. This will spread the corrections more evenly throughout the avi and it might be just what you need to get more consistent tracking.
02-05-2009 06:21 AM
Just another quick update. I converted another avi with an ac3 audio stream. In WinFF, I used the preset with "-async 2" at the end. The ffmpeg log was 100% clean. The result is perfect sound (no glitches, perfectly synchonized with video). I guess this means a couple of things:
1. ac3 audio streams can convert just as well as cbr mp3 streams with this procedure.
2. Some avi's are "dirty" and do not convert as cleanly as others. In this case, unless you take several steps to doctor the audio stream and ensure proper synchronization, the "quick procedure" can produce a very good result with minor audio glitches.
02-07-2009 08:21 AM
Another update... The following procedure has been giving consistently perfect results with large avi files (movies) on my Windows XP SP2 computer.
1. Download and install AviDemux from here: Avidemux download
2. Open the avi file in Avidemux and accept any suggestion to "fix" the avi. It may offer to unpack packed bitstreams, rebuild a frame index or something else: just accept it. It usually takes about one to two minutes to do its maintenance. Then, on the left side, make sure Video and Audio are set to "Copy" and Format is set to "AVI, unpack VOP." See the image below. Press "Ctrl S" to save the video. It will take about 5 minutes to complete the job.
3. Create a preset in WinFF as described by themichael and process the avi as fixed by Avidemux. It will take about 40 minutes on a dual core 3 GHz computer (your mileage may vary). Watch the DOS window: it should be very clean, with no error messages, like this:
4.Run the output of the WinFF job through Sansa Media Converter to transfer it to your Sansa e200v.
For me, this is the end of "out of sync" videos.
03-01-2009 11:14 PM
So i went into WinFF and edited the Presets to put the command line in from themichaels post, however, i think i might have entered it in wrong, and could use some help in regards to getting winff setup to convert the avi which avidemux processed w/out any hitches (didnt even offer to fix the file when i loaded it)
03-02-2009 05:44 AM
You're not telling us much about your problems...
In WinFF, to create the preset, choose Edit/Presets in the menu. Fill in the data as below, making sure to copy and paste the whole command line given by themichael above.
Click Add/Update and then Save.
On the main screen,on the Convert to... line, choose Sansa and then the preset you just added. Also click the Add button to add your source file in the top part. Press Convert.
03-02-2009 12:21 PM
Ok, im trying to post a pic of the conversion error but I cant seem to get the insert/edit image option to work on this page...all im entering is image url, description, and alignment, do i have to fill everything else out to post it?