All,

I have been all over this forum, reading posts and trying to understand how to create a device profile. I've learned quite a bit and have managed to hack together a device profile that s mostly working for me, but I could still use some help cleaning it up and making it fully functional.

To start, I'll give you the layout of my hardware. I have a Dish Network Hopper receiver and 2 Dish Network Joey recievers. In addition, I also have 3 Xbox 360s, 4 PCs and three Android mobile phones. Right now, my focus is on getting video streaming to the Dish Network receivers working properly. All of my devices (except of 3 PCs and the mobile phones) are on a wired Gigabit network. All of the devices can see each other as well as the Mezzmo (2.5.0.0) server.

To begin my testing, I turned off transcoding in Mezzmo for the Hopper. I noticed that several MKV files that I have played video but with no audio. I tried several Divx/Xvid videos and found that they had sound but no video. Lastly, I have several MP4s. Some are standard definition and some are h264 MPEG4s. I put together a profile based off of the Sony Bravia KDL device profile. I also stole some of the information from the Samsung B profile as well as a few others.

My hope is to create a device profile that is capable of the following:


1. If video codec is H.264/AVC/MPEG-4 AVC/MPEG-4 part 10 then pass it through without transcoding
2. If video codec is mpefg2video then pass it through without transcoding
3. If video codec is MP4 then pass it through without transcoding
4. If video codec is anything else then transcode it to Mpeg2video
5. Transcode all audio from all files to aac

Here is a copy of the device profile that I am writing as it currently stands. This profile transcodes everything and does not allow any of the video codecs mentioned above to pass through. The result is very slow performance when transcoding HD content.

Code:
<MezzmoDeviceProfile>
        <version>999</version>
        <device>
                <guid>CA027AD0-82D9-45a0-A876-7A25FB9FD846</guid>
                <name manufacturer="Dish Network" model="Hopper" profileactive="1" needstimebasedseek="1" turnoffbyterangedlna="1" needsdlnaprotocolinfo="1" supportsfolderthumbnails="1" />
                <useragent>DishNetworkHopper</useragent>
                <xavclient></xavclient>
                <mezzmoserver></mezzmoserver>
                <transcoding enabled="1" minimumstreamingsize="2048000" waitmsbeforestreaming="10000" contentlength="4" autorotateimages="0" />
                <devicedescription>GenericDeviceDescription.xml</devicedescription>
                <videomax width="1920" height="1080" />
                <imagemax width="4096" height="4096" />
        </device>
        <descriptiondeliveryrules>
        		<!-- delivery description rules specify what the device will see for each file. A file is considered to be supported if
        		     it matches a format, audio/video codecs within that format and any codec limits in this device profile. Best fit is
        		     if one of the 2 stream from a format description matches the original file. Preferred transcoded format describes 
        		     the best quality format a device can play. Transcoded list is all combinations of formats that we can encode to, 
        		     possibly including preferred transcoded and baseline. When building a file description, Mezzmo follows the following 
        		     rules order: supported, bestfit, preferredtranscoded, transcodedlist, baseline, nonsupported -->
        		<!-- please note that if transcoding is disabled or baseline and preferredtranscoded are set to no,
	        	     then the nonsupported flag is automatically set to yes. If transcoding is disabled, then only supported and
	        	     nonsupported rules are checked and used. -->
        	<supported>yes</supported>
	        	<!-- baseline, bestfit, transcodedlist, nonsupported and preferredtranscoded can be either one of: yes, no, auto
	        	     yes = always deliver, no = never deliver, auto = deliver if not delivered already by one of the rules above it -->
	       	<bestfit>auto</bestfit>
        	<preferredtranscoded>auto</preferredtranscoded>
        	<transcodedlist>auto</transcodedlist>
        	<baseline>auto</baseline>
        	<nonsupported>auto</nonsupported>
        </descriptiondeliveryrules>
        </avcontainer>
        <avcontainer id="mpeg" name="mpeg_ntsc" encode="1" mimetype="video/mpeg" baseline="1" dlnaprofile="MPEG_PS_NTSC" format="mpeg" supportschunked="0" Preferredtranscoded="0">
                <video>
                        <format id="mpeg2video" encode="1" codec="mpeg2video" preferredtranscoded="1">
                                <dimensions width="1920" height="1080" />
                                <copyts>0</copyts>
                                <samequality>0</samequality>
                                <gop>18</gop>
                                <bitrate>11000000</bitrate>
                                <bufsize>11000000</bufsize>
                                <maxbitrate>24000000</maxbitrate>
                        </format>
                </video>
                        <format id="h264" encode="1"  codec="mpeg4" Preferredtranscoded="1">
                                <copyts>0</copyts>
                                <samequality>0</samequality>
                                <gop>18</gop>
                                <bitrate>11000000</bitrate>
                                <bufsize>11000000</bufsize>
                                <maxbitrate>24000000</maxbitrate>
                        </format>
                <audio>
                        <format id="ac3" encode="1" codec="ac3" preferredtranscoded="1">
                                <channels>2</channels>
                                <channels>6</channels>
                                <bitrate>448000</bitrate>
                                <maxbitrate>448000</maxbitrate>
                                <minbitrate>64000</minbitrate>
                                <samplingrate>48000</samplingrate>
                        </format>
                </audio>
                <audio>
                        <format id="mp2" encode="0">
                        </format>
                </audio>
                <ffmpegadditional>-threads 2 -pix_fmt yuv420p -copyinkf -sc_threshold 1000000000 -coder ac -qmin 1 -cmp 2 -subcmp 2 -flags +loop -mbd bits -bsf h264_mp4toannexb -fflags +genpts+ignidx+igndts -filter:v yadif </ffmpegadditional>
        </avcontainer>
        <avcontainer id="avi" name="avi" encode="0" mimetype="video/avi" dlnaprofile="AVI" supportschunked="0" Preferredtranscoded="0">
                <video>
                        <format id="h264" encode="0">
                        </format>
                </video>
                <video>
                        <format id="mpeg4" encode="0" codec="mpeg4" Preferredtranscoded="0">
                        	<dimensions width="720" height="576" />
                        </format>
                </video>
                <audio>
                        <format id="mp3" encode="0" codec="mp3">
				<maxbitrate>256000</maxbitrate>
                        </format>
                </audio>
                <audio>
                        <format id="ac3" encode="0">
                        </format>
                </audio>
        </avcontainer>
         <avcontainer id="matroska, webm, mkv" name="mkv" encode="0" mimetype="video/x-matroska" dlnaprofile="MKV" supportschunked="0" level="100" Preferredtranscoded="0">
                <video>
                        <format id="mpeg4" encode="0">
                        </format>
                </video>
                <video>
                        <format id="h264" encode="0"  codec="mpeg4" Preferredtranscoded="0">
                                <copyts>0</copyts>
                                <samequality>0</samequality>
                                <gop>18</gop>
                                <bitrate>11000000</bitrate>
                                <bufsize>11000000</bufsize>
                                <maxbitrate>24000000</maxbitrate>
                        </format>
                </video>
                <video>
                        <format id="mpeg2video" encode="0">
                        </format>
                </video>
                <audio>
                        <format id="mp3" encode="0">
                        </format>
                </audio>
                <audio>
                        <format id="ac3" encode="0">
                        </format>
                </audio>
                <audio>
                        <format id="aac" encode="0" Preferredtranscoded="1">
                        </format>
                </audio>
        </avcontainer>
        <avcontainer id="mp3" name="mp3" encode="0" mimetype="audio/mp3" baseline="1" dlnaprofile="MP3">
                <audio>
                        <format id="mp3" encode="0" codec="libmp3lame">
                        </format>
                </audio>
        </avcontainer>
        <avcontainer id="s16be" name="lpcm" encode="1" mimetype="audio/L16" baseline="1" dlnaprofile="LPCM" preferredtranscoded="1">
                <audio>
                        <format id="s16be" encode="1" codec="pcm_s16be" preferredtranscoded="1">
                                <channels>2</channels>
                                <bitrate>1536000</bitrate>
                                <maxbitrate>1536000</maxbitrate>
                                <minbitrate>8000</minbitrate>
                                <maxsamplingrate>48000</maxsamplingrate>
                                <minsamplingrate>44100</minsamplingrate>
                                <samplingrate>48000</samplingrate>
                                <samplingrate>44100</samplingrate>
                        </format>
                </audio>
        </avcontainer>
        <avcontainer id="jpeg" name="jpeg_lrg" encode="1" mimetype="image/jpeg" baseline="1" dlnaprofile="JPEG_LRG">
        	<image>
        		<format id="jpeg" encode="1" mimetype="image/jpeg" codec="98" quality="2">
        			<maxdimensions width="4096" height="4096" />
	        		<maxbits>24</maxbits>
        		</format>
        	</image>
        </avcontainer>
        <avcontainer id="jpeg" name="jpeg_med" encode="1" mimetype="image/jpeg" baseline="1" dlnaprofile="JPEG_MED" preferredtranscoded="1">
        	<image>
        		<format id="jpeg" encode="1" mimetype="image/jpeg" codec="98" preferredtranscoded="1">
        			<maxdimensions width="1024" height="768" />
	        		<maxbits>24</maxbits>
        		</format>
        	</image>
        </avcontainer>
        <avcontainer id="jpeg" name="jpeg_sm" encode="1" mimetype="image/jpeg" baseline="1" dlnaprofile="JPEG_SM">
        	<image>
        		<format id="jpeg" encode="1" mimetype="image/jpeg" codec="98">
        			<maxdimensions width="640" height="480" />
	        		<maxbits>24</maxbits>
        		</format>
        	</image>
        </avcontainer>
        <avcontainer id="jpeg" name="jpeg_tn" encode="1" mimetype="image/jpeg" baseline="1" dlnaprofile="JPEG_TN" preferredthumbnail="1">
        	<image>
        		<format id="jpeg" encode="1" mimetype="image/jpeg" codec="98" quality="2">
        			<maxdimensions width="160" height="160" />
	        		<maxbits>24</maxbits>
        		</format>
        	</image>
        </avcontainer>
</MezzmoDeviceProfile>
In addition, here is the ffmpeg info on several of the different file types that I have tried along with the results of my trials.

This file is a standard definition avi file that is transcoded by Mezzmo on the fly and plays without issue.

Code:
ffmpeg version N-40301-gc1fe2db Copyright (c) 2000-2012 the FFmpeg developers
  built on May  3 2012 11:40:38 with gcc 4.6.3
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 49.100 / 51. 49.100
  libavcodec     54. 17.101 / 54. 17.101
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.104 /  2. 72.104
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, avi, from 'F:\Movies\10 Things I Hate About You (1999)\10 Things I Hate About You (1999).avi':
  Metadata:
    title           : 10 Things I Hate About You
    album           : 10 Things I Hate About You (1999)
    date            : 1999
    ICMS            : Touchstone Pictures
    IRTD            : PG-13 (Parental Guidance Suggested)
    ISTR            : Julia Stiles; Cameron Fraser; Joseph Gordon-Levitt; Tarance Houston; Greg Jackson (II)
    encoder         : Nandub v1.0rc2
    ITRK            : 0
  Duration: 01:37:29.47, start: 0.000000, bitrate: 1005 kb/s
    Stream #0:0: Video: mpeg4 (XVID / 0x44495658), yuv420p, 512x272 [SAR 1:1 DAR 32:17], 23.98 fps, 23.98 tbr, 23.98 tbn, 2 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16, 128 kb/s
At least one output file must be specified


---> DB Level Info: -99, -99
---> Frame rate: 23.98
---> Aspect ratio: 32:17
This is a standard definition MP4 file that also was transcoded on the fly by Mezzmo and played without issue.

Code:
ffmpeg version N-40301-gc1fe2db Copyright (c) 2000-2012 the FFmpeg developers
  built on May  3 2012 11:40:38 with gcc 4.6.3
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 49.100 / 51. 49.100
  libavcodec     54. 17.101 / 54. 17.101
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.104 /  2. 72.104
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\Movies\American Beauty (1999)\American Beauty (1999).mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: mp41
    creation_time   : 1970-01-01 00:00:00
    title           : AMERICAN_BEAUTY
    encoder         : Lavf51.18.0
  Duration: 02:01:34.85, start: 0.000000, bitrate: 1016 kb/s
    Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 512x288 [SAR 1:1 DAR 16:9], 883 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 127 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : SoundHandler
At least one output file must be specified


---> DB Level Info: 1, 0
---> Frame rate: 29.97
---> Aspect ratio: 16:9
This is an example of an high definition MP4 file that transcodes too slowly and studders during playback. The Hopper and Joeys all support native playback of this video stream so I would like Mezzmo to pass it through without transcoding it.

Code:
ffmpeg version N-40301-gc1fe2db Copyright (c) 2000-2012 the FFmpeg developers
  built on May  3 2012 11:40:38 with gcc 4.6.3
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 49.100 / 51. 49.100
  libavcodec     54. 17.101 / 54. 17.101
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.104 /  2. 72.104
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\Movies\Iron Man 2 (2010)\Iron Man 2 (2010).mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.3.100
  Duration: 02:04:39.16, start: 0.000000, bitrate: 10294 kb/s
    Chapter #0.0: start 0.000000, end 304.302000
    Metadata:
      title           : 00:00:00.000
    Chapter #0.1: start 304.302000, end 667.582000
    Metadata:
      title           : 00:05:04.302
    Chapter #0.2: start 667.582000, end 1079.952000
    Metadata:
      title           : 00:11:07.582
    Chapter #0.3: start 1079.952000, end 1553.009000
    Metadata:
      title           : 00:17:59.952
    Chapter #0.4: start 1553.009000, end 1826.782000
    Metadata:
      title           : 00:25:53.009
    Chapter #0.5: start 1826.782000, end 2253.000000
    Metadata:
      title           : 00:30:26.782
    Chapter #0.6: start 2253.000000, end 2639.635000
    Metadata:
      title           : 00:37:33.000
    Chapter #0.7: start 2639.635000, end 3099.346000
    Metadata:
      title           : 00:43:59.635
    Chapter #0.8: start 3099.346000, end 3610.523000
    Metadata:
      title           : 00:51:39.346
    Chapter #0.9: start 3610.523000, end 4021.516000
    Metadata:
      title           : 01:00:10.523
    Chapter #0.10: start 4021.516000, end 4560.764000
    Metadata:
      title           : 01:07:01.516
    Chapter #0.11: start 4560.764000, end 4873.283000
    Metadata:
      title           : 01:16:00.764
    Chapter #0.12: start 4873.283000, end 5433.551000
    Metadata:
      title           : 01:21:13.283
    Chapter #0.13: start 5433.551000, end 5929.338000
    Metadata:
      title           : 01:30:33.551
    Chapter #0.14: start 5929.338000, end 6341.792000
    Metadata:
      title           : 01:38:49.338
    Chapter #0.15: start 6341.792000, end 6857.350000
    Metadata:
      title           : 01:45:41.792
    Chapter #0.16: start 6857.350000, end 7479.168000
    Metadata:
      title           : 01:54:17.350
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x816, 10107 kb/s, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 177 kb/s
    Metadata:
      handler_name    : SoundHandler
At least one output file must be specified


---> DB Level Info: 41, 100
---> Frame rate: 23.98
---> Aspect ratio:
Finally, here is an example of a high definition mkv file that transcodes too slowly and studders during playback. Again, the H.264/AVC/MPEG-4 video codec used by this file type should be native to the Hopper and the Joeys. If it can be passed through while only transcoding the audio to aac, this would greatly improve the playback of the video.

Code:
ffmpeg version N-40301-gc1fe2db Copyright (c) 2000-2012 the FFmpeg developers
  built on May  3 2012 11:40:38 with gcc 4.6.3
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 49.100 / 51. 49.100
  libavcodec     54. 17.101 / 54. 17.101
  libavformat    54.  3.100 / 54.  3.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 72.104 /  2. 72.104
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 11.100 /  0. 11.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, matroska,webm, from 'F:\Movies\Captain America - The First Avenger (2011)\Captain America - The First Avenger (2011).mkv':
  Metadata:
    creation_time   : 2011-10-15 00:46:17
  Duration: 02:04:11.61, start: 0.000000, bitrate: 10075 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p, 1920x816 [SAR 1:1 DAR 40:17], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s (default)
At least one output file must be specified


---> DB Level Info: 41, 100
---> Frame rate: 23.98
---> Aspect ratio: 40:17
Any assistance that anyone could provide to help me get this profile ironed out would be greatly appreciated.

Thanks

James