{"id":118,"date":"2011-05-10T15:47:30","date_gmt":"2011-05-10T19:47:30","guid":{"rendered":"http:\/\/griffinscs.wordpress.com\/?p=118"},"modified":"2016-11-21T16:50:29","modified_gmt":"2016-11-21T16:50:29","slug":"transcode-to-mp4","status":"publish","type":"post","link":"https:\/\/brainslug.azurewebsites.net\/?p=118","title":{"rendered":"Transcode to MP4"},"content":{"rendered":"<p style=\"text-align: left;\">A few weeks ago, I <a href=\"\/blog\/?p=104\">talked about<\/a> playing with WPF and DirectShow with WPF MediaKit.\u00a0 I wanted to finish a video transcoder project I had laying around for some time.\u00a0 Originally, it was a very simple WinForms app that guides the process of building a graph in DirectShow to extract the audio and video streams from some video file source, send them through some other compressor (or not), and place them in an MP4 container.\u00a0 The goal was to allow my wife to convert the files from her camera, so she could post them on YouTube (She didn't want to use <a href=\"http:\/\/en.wikipedia.org\/wiki\/GraphEdit\">GraphEdit<\/a>, imagine that).\u00a0 At the time, <a href=\"http:\/\/handbrake.fr\/\">HandBrake<\/a> didn't exist, or wasn't available on Windows and there were plenty of paid options, but I figured I could mock up a solution at a similar cost.\u00a0 That was true, until I moved it to WPF and added a video preview, but whatever, it was fun.\u00a0 This is the result:<a href=\"http:\/\/dl.dropbox.com\/u\/8701079\/TranscodeToMP4.exe\"><img loading=\"lazy\" class=\"aligncenter size-full wp-image-125\" title=\"Transcoder\" src=\"\/wp-content\/uploads\/2016\/11\/transcoder1.png\" alt=\"\" width=\"630\" height=\"472\" \/><\/a><\/p>\n<p><a href=\"http:\/\/dl.dropbox.com\/u\/8701079\/TranscodeToMP4.exe\">Transcode to MP4<\/a> - Version 1.0.0.0<br \/>\n<a href=\"http:\/\/github.com\/jeffgriffin\/Blog\">Source<\/a><\/p>\n<p><strong>Required<\/strong><span style=\"text-decoration: underline;\">:<br \/>\n<\/span><\/p>\n<p><a href=\"http:\/\/haali.su\/mkv\/\">Haali Media Splitter<\/a>: Actually, only the MP4 Multiplexer is required, but the splitter is a handy file source, supporting many formats.<\/p>\n<p><a href=\"http:\/\/www.microsoft.com\/downloads\/en\/details.aspx?FamilyID=5765d7a8-7722-4888-a970-ac39b33fd8ab\">.NET 4.0 Client Profile<\/a><\/p>\n<p><strong>Recomended:<\/strong><\/p>\n<p><a href=\"http:\/\/ffdshow-tryout.sourceforge.net\/download.php\">FFDShow Tryouts<\/a>: This adds a ton of functionality and customization, through the filter settings dialogs. <em>See Issues and Solutions below. <\/em><\/p>\n<p><a href=\"http:\/\/dl.dropbox.com\/u\/8701079\/MonogramAACEncoder.zip\">MONOGRAM AAC Encoder<\/a>: This is my own build of this filter.\u00a0 I found this and a number of other GPL and LGPL based DirectShow filters at <a href=\"http:\/\/blog.monogram.sk\/janos\/directshow-filters\/\">RadScorpion's blog<\/a>.\u00a0 I wanted to use this filter, but it doesn't register as an Audio Compressor in DirectShow, which this Transcoder requires.\u00a0 If you would like the source for my changes, please don't hesitate to ask.<\/p>\n<p>There are a number of other filter options you can experiment with, and of course your mileage may vary.\u00a0 Also, this program will attempt to allow you to make any decision you want about what codecs you would like to use.\u00a0 That doesn't mean that the MP4 Multiplexer or your video player of choice will appreciate the decision you made, and this program does not protect you from this.<\/p>\n<p><strong>Options:<\/strong><\/p>\n<p>The <em>Show Preview<\/em> option can be found in the render options menu.\u00a0 Some filters don't work so nicely with the Pin Tee Filter, which is used to show a video preview during the encoding process.\u00a0 Turning off the Show Preview option lets this program build a graph without including the Pin Tee and Video Renderer.\u00a0 Media Center filters will require the Show Preview setting to be off.<\/p>\n<p>The<em> Use Clock<\/em> option is the same as the one found in GraphEdit.\u00a0 It will generally allow the graph to progress at or below the speed of playback.\u00a0 You should always try leaving this option off for the sake of speed, but some filters don't appreciate being rushed.<\/p>\n<p>Clicking on the gear icon next to the selected decoder filter will pop the filter's configuration dialog (if it has one).\u00a0 These are implemented by the filter's vendor.<\/p>\n<p><strong>Issues and Solutions:<\/strong><\/p>\n<p>I found out while testing this with the filters Media Center uses with WTV and DVR-MS files that some files aren't so happy working outside the bounds of their original intent.\u00a0 I did have success transcoding these formats, however, by turning off the <em>Show Preview<\/em> option.<\/p>\n<p style=\"text-align: left;\">In testing with FFDShow Tryouts, files with MPEG audio streams tended to halt or crash the program.\u00a0 This was corrected by going into the FFDShow Audio Decoder Configuration in the start menu, and under Codecs, I switched the MP1,MP2 decoder from libmad to libavcodec.<a href=\"wp-content\/uploads\/2016\/11\/audiodecoder1.png\"><img loading=\"lazy\" class=\"aligncenter wp-image-133 size-full\" title=\"FFDShow Tryouts Audio Decoder Configuration\" src=\"\/wp-content\/uploads\/2016\/11\/audiodecoder1.png\" width=\"568\" height=\"479\" \/><\/a><\/p>\n<p style=\"text-align: left;\"><strong>Why not just use HandBrake now?<\/strong><\/p>\n<p>By all means, you should if it suits your needs.\u00a0 HandBrake offers tons of options, is relatively user friendly and doesn't require all this mucking about with DirectShow filters.\u00a0 If it were out when I wrote the first pass of this, I would have had no motivation to write it.\u00a0 However this is an extremely open-ended tool, so if you need to transcode something that handbrake doesn't support, but for which there are DirectShow filters available, you can use this as an alternative to GraphEdit.\u00a0 Media Center files are a good example of this.<\/p>\n<p>Please leave me a feedback if you are experiencing issues using this tool, you have feature requests, or other questions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few weeks ago, I talked about playing with WPF and DirectShow with WPF MediaKit.\u00a0 I wanted to finish a video transcoder project I had laying around for some time.\u00a0 Originally, it was a very simple WinForms app that guides the process of building a graph in DirectShow to extract the audio and video streams [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,1],"tags":[6,13,16,19,22,23,28,31,32,42,52,53,59,60,61],"_links":{"self":[{"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/posts\/118"}],"collection":[{"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=118"}],"version-history":[{"count":4,"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":679,"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions\/679"}],"wp:attachment":[{"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brainslug.azurewebsites.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}