Support and General Use > Plugins/Viewers
TMPEGEnc template for MPEGs on Sansa E200 series
(1/1)
RowaN:
Might be useful to someone.. my first stab at a template for encoding Sansa E200 friendly MPEGs using TMPEGEnc (www.tmpgenc.net). Correct video size, aspect ratio, full screen etc. Feel free to alter the quality setting (changes encoding time). At present videos dont play perfect, and end up badly losing sync (even with todays build), but I guess thats down to Rockbox not the file this template produces. If anyone feels they can do better or can suggest an improvement, why not post it here?
Save this code block as a file called sansa.mcf:
--- Code: ---object TMPEGConfigFile
 MPEG.WizardTargetMedia = MPEGConfig_TargetMediaType_Unknown
 MPEG.WizardAutoCalcVideoBitRate = False
 MPEG.WizardAutoChooseList.EnableVideoSize = False
 MPEG.WizardAutoChooseList.VideoSize =
 MPEG.WizardAutoChooseList.EnableVideoGOP = False
 MPEG.WizardAutoChooseList.VideoGOP =
 MPEG.OutputStreamType = MPEG_OutputStreamType_System_VideoAudio
 MPEG.OutputStreamType_ReadOnly = False
 MPEG.Video.StreamType = MPEGVideoEncoder_StreamType_MPEG1
 MPEG.Video.StreamType_ReadOnly = False
 MPEG.Video.Width = 224
 MPEG.Video.Width_ReadOnly = False
 MPEG.Video.Height = 176
 MPEG.Video.Height_ReadOnly = False
 MPEG.Video.YUVFormat = 1
 MPEG.Video.YUVFormat_ReadOnly = False
 MPEG.Video.DC_prec = 1
 MPEG.Video.DC_prec_ReadOnly = False
 MPEG.Video.VideoEncodeMode = MPEGVideoEncoder_VideoEncodeMode_Interlace
 MPEG.Video.VideoEncodeMode_ReadOnly = False
 MPEG.Video.FrameRate = 131076
 MPEG.Video.FrameRate_ReadOnly = False
 MPEG.Video.AspectRatio = 6
 MPEG.Video.AspectRatio_ReadOnly = False
 MPEG.Video.RateControlMode = MPEGVideoEncoder_RateControlMode_CQ
 MPEG.Video.RateControlMode_ReadOnly = False
 MPEG.Video.MaxBitRate = 0
 MPEG.Video.MaxBitRate_ReadOnly = False
 MPEG.Video.MinBitRate = 0
 MPEG.Video.MinBitRate_ReadOnly = False
 MPEG.Video.MinAvgBitRate = 0
 MPEG.Video.MinAvgBitRate_ReadOnly = False
 MPEG.Video.CBR_BitRate = 7000000
 MPEG.Video.VBR_MultipassVBRAlgorithm = MPEGVideoEncoder_MultipassVBRAlgorithm_MultipassCQ
 MPEG.Video.VBR_AvgBitRate = 7000000
 MPEG.Video.VBR_MaxBitRate = 8000000
 MPEG.Video.VBR_MinBitRate = 2000000
 MPEG.Video.VBR_MaxPassCount = 2
 MPEG.Video.VBR_EnablePadding = False
 MPEG.Video.MVBR_MaxBitRate = 8000000
 MPEG.Video.MVBR_MinBitRate = 2000000
 MPEG.Video.MVBR_EnablePadding = False
 MPEG.Video.AVBR_MaxBitRate = 8000000
 MPEG.Video.AVBR_MinBitRate = 2000000
 MPEG.Video.AVBR_EnablePadding = False
 MPEG.Video.CQ_MaxBitRate = 8000000
 MPEG.Video.CQ_MinBitRate = 2000000
 MPEG.Video.CQ_EnablePadding = False
 MPEG.Video.VBVBufferSize = 229376
 MPEG.Video.VBVBufferSize_ReadOnly = False
 MPEG.Video.GOP_SeqHeaderInterval = 1
 MPEG.Video.GOP_SeqHeaderInterval_ReadOnly = False
 MPEG.Video.GOP_I_FrameCount = 1
 MPEG.Video.GOP_I_FrameCount_ReadOnly = False
 MPEG.Video.GOP_P_FrameCount = 5
 MPEG.Video.GOP_P_FrameCount_ReadOnly = False
 MPEG.Video.GOP_B_FrameCount = 2
 MPEG.Video.GOP_B_FrameCount_ReadOnly = False
 MPEG.Video.GOP_BitStreamForEdit = True
 MPEG.Video.GOP_BitStreamForEdit_ReadOnly = False
 MPEG.Video.GOP_MaxFrameCount = 18
 MPEG.Video.GOP_MaxFrameCount_ReadOnly = False
 MPEG.Video.QuantizeMatrix_Intra_ReadOnly = False
 MPEG.Video.QuantizeMatrix_NonIntra_ReadOnly = False
 MPEG.Video.Profile = 4
 MPEG.Video.Profile_ReadOnly = False
 MPEG.Video.Level = 8
 MPEG.Video.Level_ReadOnly = False
 MPEG.Video.VideoFormat = 2
 MPEG.Video.VideoFormat_ReadOnly = False
 MPEG.Video.DisplayWidth = 0
 MPEG.Video.DisplayWidth_ReadOnly = True
 MPEG.Video.DisplayHeight = 0
 MPEG.Video.DisplayHeight_ReadOnly = True
 MPEG.Video.MotionSearchSpeed = MPEGVideoEncoder_MotionSearchSpeed_Normal
 MPEG.Video.MotionSearch_AlwaysHalfPel = False
 MPEG.Video.UseFloatDCT = False
 MPEG.Video.QuantizeMode = False
 MPEG.Video.QuantizeModeVal_Intra = 35
 MPEG.Video.QuantizeModeVal_NonIntra = 35
 MPEG.Video.YUVBasicYCbCr = False
 MPEG.Video.QuantizeMatrix_Intra = {
  081013161A1B1D22101016181B1D222513161A1B1D22222616161A1B1D222528
  161A1B1D202328301A1B1D202328303A1A1B1D22262E38451B1D23262E384553}
 MPEG.Video.QuantizeMatrix_NonIntra = {
  1011121314151617111213141516171812131415161718191314151617181A1B
  14151617191A1B1C151617181A1B1C1E1617181A1B1C1E1F1718191B1C1E1F21}
 MPEG.Video.VBR_Quality_P = 0.000000000000000000
 MPEG.Video.VBR_Quality_B = 20.000000000000000000
 MPEG.Video.MVBR_Quality_P = 0.000000000000000000
 MPEG.Video.MVBR_Quality_B = 20.000000000000000000
 MPEG.Video.AVBR_Quality = 50.000000000000000000
 MPEG.Video.CQ_Quality = 65.000000000000000000
 MPEG.Video.CQ_Quality_P = 0.000000000000000000
 MPEG.Video.CQ_Quality_B = 20.000000000000000000
 MPEG.Audio.StreamType = MPEGAudioEncoder_StreamType_MPEG1_Layer2
 MPEG.Audio.StreamType_ReadOnly = False
 MPEG.Audio.SamplingFrequency = 44100
 MPEG.Audio.SamplingFrequency_ReadOnly = False
 MPEG.Audio.ChannelMode = 0
 MPEG.Audio.ChannelMode_ReadOnly = False
 MPEG.Audio.CantUseMono = False
 MPEG.Audio.BitRate = 192000
 MPEG.Audio.BitRate_ReadOnly = False
 MPEG.Audio.CalcCRC = True
 MPEG.Audio.CalcCRC_ReadOnly = False
 MPEG.Audio.OriginalFlag = False
 MPEG.Audio.OriginalFlag_ReadOnly = False
 MPEG.Audio.CopyrightFlag = False
 MPEG.Audio.CopyrightFlag_ReadOnly = False
 MPEG.Audio.PrivateFlag = False
 MPEG.Audio.PrivateFlag_ReadOnly = False
 MPEG.Audio.EmphasisType = 0
 MPEG.Audio.EmphasisType_ReadOnly = False
 MPEG.System.StreamType = MPEGSystemEncoder_StreamType_MPEG1
 MPEG.System.StreamType_ReadOnly = False
 MPEG.System.EnableCommentText = False
end
--- End code ---
soap:
Some comments on this config:
1- TMPEGEnc is only free (as in beer) for MPEG1, the encoders suggested in the wiki are free (speech and beer) for MPEG2.
2- TMPEGEnc (in my testing) won't create the 14.985 FPS file you are trying to make. It will create a 29.97 FPS file with duplicate frames, as 14.985 is a non-standard frameratre. ffmpeg in the wiki will create honest sub-23.976 FPS files, non-standard as they might be.
3- Under the "Video" tab, changing "Motion Search Precision" to "High quality" improves high-action scenes dramatically, but does slow encoding down.
4- Your Max and Min bitrates of 8000 and 2000 kbps are about 20 times what I would expect to be adequate. This and #2 are why your videos are falling out of sync.
5- Under the "Quantize matrix" tab, "Use floating point DCT" adds a little to compression time, but seems to be worth it.
6- You have the input file Aspect Ratio at 16:9, yet are exporting to a 4:3. Not always a problem, but you should be aware of that.
7- TMPEGEnc's audio encoder is not the best. The wiki encoders do a better job. When I use TMPEGEnc as my encoder I only let it do the video, and have TooLAME do the audio, then mux with TMPEGEnc's MPEG tools. But that's the smallest thing.
EDIT:
Just verified #2. Using your .mcf config file, a 30.564 second long test sample has 916 frames, 29.97 FPS.
#4 is odd, as TMPEGEnc appears to be ignoring your constraints. Still it is encoding the video stream at an average of 674kbps, which is still quite high for that size video. 431kbps would be the equivalent of the SVCD bitrate at that resolution, and 469kbps was the average bitrate of the wiki encodes of Elephant's Dream.
Llorean:
Last note: You should never post "permanent" or "static" information here. These are discussion forums, information that should be static should be attached to the wiki. You could've simply attached sansa.mcf to the wiki page and added a usage description in the encoders section for TMPGEnc (though I'm personally not fond of it when there are very adequate GPL alternatives).
RowaN:
Thanks very much for your tips soap. I might well abandon this now then - I couldnt get TMPEGenc to produce proper 14fps file either. I didnt know Rockbox could play mpeg2 files!
Navigation
[0] Message Index
Go to full version