This project is read-only.

Server-side re-encoding

Jun 3, 2008 at 1:24 AM
Discuss, vote, and comment on this feature idea.
Jun 10, 2008 at 3:42 PM
Edited Jun 10, 2008 at 3:44 PM
chevas,

I had this feature implemented in the May tech preview, however the new silverlight uploader breaks my code. Also there does not seem to be a copy of the silverlight app's source code included in the June release; there is only the .xap file. Could you send me a link where I could download the source.  

Thanks,
Xavier Keil
Jun 10, 2008 at 8:19 PM

Xavier,

Please tell us more about the code breakage you are experiencing.  Examples of details that would be helpful, as described by one of our developers, can be found below:

We need to know the specifics of the error: What page they get it on, when it happens (load time, upload time, etc.), the nature of the error (error messages, blank upload webpart, unhandled exception pages, etc.), does the HTTP POST Uploader work for them. The more detail the better.

 

We also need to know their setup… is the site Internal or External, does it allow anonymous access, is the path the files are getting saved to on the local server or a network share?

As for the code to the Silverlight Uploader, we don't yet have explicit permission to share that out yet.  I'll see about getting permission to share this, but in the meantime, please send us more details about your error.

Thanks.

Jeff


keilxo wrote:
chevas,

I had this feature implemented in the May tech preview, however the new silverlight uploader breaks my code. Also there does not seem to be a copy of the silverlight app's source code included in the June release; there is only the .xap file. Could you send me a link where I could download the source.  

Thanks,
Xavier Keil


Jun 10, 2008 at 9:43 PM
Jeff,

I am sorry I was not more clear. By the code being broken I mean that in the May release there was no Silverlight Upload feature. Now that there is one I would like to use that but I cannot edit the source for it to reencode the videos. I think that I could possibly work around this by editing the UploadHandler.aspx.cs file to do it (not sure if this is possible) but It would be easier for me to just port over the code I already wrote for the UploadFiles.dll from the May release. So there is no error. My code is very simple all it does is open up ffmpeg, reencode the video and pass the new file name to the FileUrl feild. I really just want access to the Silverlight Uploader source. Let me know how the request for that develops.

Thanks,
Xavier Keil  
Jun 11, 2008 at 4:41 AM
Hi Xavier, I love the fact that you have developed a server-side re-encoding already! Have you thought about sharing back this new feature with the community, maybe leveraging our child project program? I'd be more than happy to discuss this with you. Just ping me on the discussion boards if you're interested, with a way to contact you.
The code for the silverlight uploader is going to be available very soon, tomorrow or the day after. It should have been part of the June Tech Preview. Cheers, Ludo.
Jun 11, 2008 at 4:03 PM
Edited Jun 11, 2008 at 8:08 PM

Hi Ludo,

           I have provided links in this post for both the source and ffmpeg which is required. I must admit that this is a bit of a dirty hack; it currently requires that ffmpeg.exe be located at C:/ffmpeg.exe on the server. Also it obviously requires that you have the necessary codec’s installed for the conversions. There is minimal error handling and it is broken by non standard characters and long file names. Also so far I have only added support for .avi,.mov,.mpg and .mp3 file extensions.

(NOT FOR USE WITH THE JUNE RELEASE. MAY ONLY)
You can download my code here (visual studio c# project)
http://www.megaupload.com/?d=Z5JNSSD9
the ffmpeg version I use is here (this download is a win32 binary .exe file)
http://www.megaupload.com/?d=YMCOEVKQ


I plan on making major improvements to this over the next few days and of course adapting it for the June release. I am more than happy to share this source with the community and all further updates as I finish them. You or anyone else who is interested can feel free to contact me at the following email addresses or by replying to this post.

keilxo[at]airproducts.com
xok210[at]lehigh.edu

Please let me know when you get the Silverlight uploader and the http uploader source from the June release and it is made available.

PS sorry to use megaupload I know it is not the best distribution channel however I was hesitant to use the upload a patch feature on this site since this is a very early alpha and no one should install it without some careful thought. Also I am pretty sure that installing this on the June release would at best break the bulk upload feature and at worst take uploading out entirely. I have not tried this yet but I plan on trying today. I will let you know how it goes.   

Jun 11, 2008 at 5:56 PM

Xavier,

I've received confirmation that the remainder of the source code will be uploaded later today.  In the meantime, a member of the PKS Dev Team has suggested the following:

In the new UploadFiles DLL there is a class, SilverlightUploadFieldControl, that receives a list of the files that the Silverlight client uploaded. You should be able to iterate through the list and convert the files at this point. In the method OnRaisePostDataChangedEvent, there is a loop that goes through the files and adds them to the FilesMetaData list, which would be the ideal place to do conversions and store the new name of the primary file.

Hope this helps.

Jeff 

Jun 11, 2008 at 8:06 PM
Jeff,

Thanks a lot. I will keep you all posted as I work on this throughout the week. Also I tried using my old upload files in the new release and it broke all the uploading. Obviously there were some major changes to that portion of the code since the May release.

Thanks everyone for the quick replies.

Xavier
Jun 11, 2008 at 9:19 PM

Xavier,

Please note that the source code you requested earlier is now available on the Releases tab of this site (see PKS - June 2008 Tech Preview - PreReqs Source.zip).

Keep us in the loop of your progress, and let us know if there's anything else we can do to help.

Jeff 

 

Jun 11, 2008 at 9:33 PM
Jeff and Ludo,

Thanks for the help, everything looks good and I will keep you in the loop. Hopefully I will have something to post tomorrow late afternoon.
 
Thanks again.

Xavier
Jun 12, 2008 at 7:26 PM
Thanks Xavier and good luck. Let us know how it goes. I've received your other email and will respond very soon (taking tomorrow off for some needed rest :)).
Ludo.
Jun 13, 2008 at 2:05 PM
Edited Jun 13, 2008 at 2:39 PM
Great thanks a lot Ludo I will look forward to getting your email. Enjoy your vacation.

Jeff if you are around today I have run into a little problem. I have ported over most of my code to the new release but I am unable to compile it. My code is all in the UploadFiles project which is dependent on the PKS.silverlight.fileupload project. However this project refuses to open so I cannot compile it. I am running Visual Studio 2008 team suite with Silverlight tools 2.0 beta installed. Every time I try to open that project I get a project type not supported by installation of visual studio error. This happens also if I use the older 1.1 alpha version of the silverlight tools or the newer alpha for visual studio 2.0 beta. 
Thanks,
Xavier   

(edit) I also tried with the professional edition of visual studio with the same result (edit)
Jun 13, 2008 at 7:26 PM

Xavier,

Please see the note below from a member of the PKS Development Team.  Hopefully this helps.  If you're still having problems, send further details as we'll see what we can do.

Jeff Bean
3Sharp
PKS Development Team

Upload Files is not dependant on PKS.Silverlight.FileUpload … it already has the compiled XAP as part of its solution (under Setup/12/Template/ControlTemplates/SilverlightUpload) and it is set to content.

 

PKS.Silverlight.FileUpload was created with Silverlight 2 Beta 1 (just to clarify). If no changes were made to it then it won’t need to be compiled to get Upload Files working, though. It can also be removed from the Solution safely without affecting any of the other parts if there are problems with the project.

 

If he can send more information on the compile error he is getting with Upload Files I can try offer assistance.

Jun 16, 2008 at 4:20 PM
Edited Jun 16, 2008 at 4:39 PM
Jeff,

I figured out my problem, something was wrong with my install of visual studio. I reinstalled and everything was fine, I kept getting errors about being unable to compile since I could not open that PKS.Silverlight.FileUpload solution, strange. Anyways now I have everything up and running and am working on testing my code. Right now I have succeeded in turning the UploadFiles Silverlight application into a white box but hopefully this will change in the near future. In order to apply my custom solution all I should have to do is preform a gacutil /i  on the new uploadfiles.dll that is created after I build my project right?

Also this error occurs if I have the line "  slControl.Version = "2.0"  "  in the code

Error 1 'System.Web.UI.SilverlightControls.Silverlight' does not contain a definition for 'Version' and no extension method 'Version' accepting a first argument of type 'System.Web.UI.SilverlightControls.Silverlight' could be found (are you missing a using directive or an assembly reference?) 

I just commented it out but that might be what is causing my white box problem. Could this be the case?
 
Thanks for all the help
Xavier Keil 
Jun 16, 2008 at 8:39 PM

Xavier,

In response to your questions, a member of the PKS Development Team provided the following.  Please review and let me know if you have any more questions.

Jeff Bean
3Sharp
PKS Development Team

1)      After UploadFiles is compiled, installing it into the GAC and doing an IIS Reset will load the new version of the control.

2)      As for the Version problem, the property should be there, assuming that the Silverlight Beta 1 Tools for Visual Studio were installed. We have not tried compiling under Beta 2, yet, so that may be an issue.

3)      When the Silverlight control is loaded, it will appear as a white box if there was a problem loading the XAP application. This could  be because the MIME Type is set improperly under IIS. If it is set to application/x-silverlight and the version tag is not there it might be trying to load under the 1.1 runtime. Without the version tag, it should load properly if the MIME Type is set to application/x-silverlight-2-b1. We haven’t tested this though. Note: the second MIME type will require that the Silverlight 2 Beta 1 runtime is installed on the Server.

Jun 17, 2008 at 6:18 PM
Edited Jun 17, 2008 at 8:24 PM
Jeff and Ludo,

I now have the reencoder working for .mp3, .mov, .mpg, .mpeg and .avi on the june release. I commented out the slcontrol.version stuff from the code because no matter what version of silverlight tools I used it would not compile, but other than that it seems to work. Does doing this break other functionality that I might not have tested? Anyways links to the code follow below. If you don't want to bother with compilation I have included links to the uploadfiles.dll and the ffmpeg.exe binaries. Keep in mind before implementing this that this is all very very alpha and might break your server, I make no guarantees about the functionality of this code. Also using this creates lots of dupes of files that are uploaded on the server because It simply reencodes to .wmv and leaves the original file alone. I will try to change this in the future. I plan continuing improvements for this patch including but not limited to cleaning up the code and adding support for more file types. If anyone has any questions feel free to ask me on this thread. Also if you implement this please let me know how it goes.

PS I have not tested this yet but I am pretty sure that long file names and non standard characters (anything other than A-Z and 0-9) will break this solution fix coming soon.
 PPS This version still requires that ffmpeg.exe be in the C:\ drive root folder.

JUNE release files (not for use with may release) - see previous posts for that

Binaries (ffmpeg is here + readme) -  http://www.megaupload.com/?d=H769XSEP
Source (Also download Binary package because it has readme and ffmpeg) -  http://www.megaupload.com/?d=T1HXWLTD
The source is the entire prerequisites solution so it is a big file sorry

Xavier Keil

(edit) I have created a project page for these files so I do not have to continue using megaupload you can find it here http://www.codeplex.com/REPKS (edit)

Jun 18, 2008 at 1:29 AM
Xavier,

Thanks for all you have already added. 

Although we have not tested it, we believe that your commenting out the slcontrol.version stuff from the code should not break anything else from PKS.  According to one of our developers, "...the setting is just for IE so it knows which runtime to load. If it is missing it shouldn’t affect anything, because the MIME-Type also declares the specific version. "  Please let us  know if you find otherwise.

Also, we have still not encountered the same compile problems you have noted.  If it helps with any additional troubleshooting you may be doing, "...we are using the Silverlight Control from System.Web.Silverlight, Version 2.0.5.0."

Jeff Bean
3Sharp
PKS Development Team
Jun 18, 2008 at 7:36 PM
Edited Jun 18, 2008 at 8:44 PM
Jeff,

Ok the version of System.Web.Silverlight that I am using is assembly version 2.0.5.0 and full version 2.0.10125.0 I am assuming that this is the same version that you are talking about. I still cannot get it to recognize the slcontrol.version stuff. My code is posted as the default release in the project site that I have created if you want to look at it but it is basically the prerequisites soultion with an extra few lines. What happens now that I have that commented out slcontrol.version is that people with the wrong version of silverlight see a white box, people without silverlight have their browser crash and people with the correct version of silverlight (2.0.30226.2) see the upload files silverlight app and everything including server side reencoding works perfectly. I would really like to get this versioning stuff working so that it prompts the user to download the correct version when loaded. Any advice would be greatly appriciated.   

Thanks
Xavier Keil
Jun 18, 2008 at 8:52 PM
Jeff,

I tried to fix this by using slcontrol.minimumversion = "2.0" which compiles but then generates this error on the server


 

Server Error in '/' Application.

Method not found: 'Void System.Web.UI.SilverlightControls.Silverlight.set_MinimumVersion(System.String)'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: Method not found: 'Void System.Web.UI.SilverlightControls.Silverlight.set_MinimumVersion(System.String)'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[MissingMethodException: Method not found: 'Void System.Web.UI.SilverlightControls.Silverlight.set_MinimumVersion(System.String)'.]
   UploadFiles.SilverlightUploadFieldControl.CreateChildControls() +0
   System.Web.UI.Control.EnsureChildControls() +87
   Microsoft.SharePoint.WebControls.BaseFieldControl.OnLoad(EventArgs e) +176
   UploadFiles.SilverlightUploadFieldControl.OnLoad(EventArgs e) +41
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

Jun 19, 2008 at 10:01 PM
Xavier,

I have to admit we're a bit stumped with this problem.  One of our developers looked over the scenario you described and could only offer the following:

"...sounds like maybe there is a problem with his Silverlight Tools install… Obviously, not having the Version is causing problems with IE – so he needs to figure out what is wrong with his copy of Silverlight, because I’ve installed it several times and never come across this issue."

Without being able to reproduce this error ourselves, I'm not sure what else we can do for you for this particular issue. 

If' you'd like us to continue looking into this, we'll need you to send us full repro steps/scenario. 

Otherwise, we'll be anxious to learn what you find out in your own troubleshooting.

Thanks.

Jeff Bean
3Sharp
PKS Development Team
Jun 20, 2008 at 3:48 PM

Jeff,

Thanks so much for looking into this problem for me. I did a bit of troubleshooting and it turned out to be a classic case of issue misdiagnosis by me.

The problem had to do with the permissions being incorrectly set on the server for access to ffmpeg.exe. What I think was happening is when the SilverLight uploader loaded on the page it sent an authentication request to the user since the permissions were incorrectly set. These requests must have gone out before version checking was done and for some reason when it did not get a valid responce from the user it never did the version checking. If you had the incorrect verison of SilverLight you got a white box and if you did not have SilverLight at all you got a browser crash.

I have fixed the permissions issue and now everything works fine. Except I guess if someone without the correct permissions somehow got on the site it would crash their browser, but I think I can write that off as a security feature. Basically a nonissue.
 
I plan on continuing updates, cleaning up my code, adding more file type support and making it easier to install. All further updates will be on the project page at  http://www.codeplex.com/REPKS.

Thanks for all the help.

Xavier Keil