0

I am trying to build a WCF Service to send a video stream using DASH and MPD. I am stuck when I am sending the MP4 file. Per Wirewhark my file is being sent as protocol http and media type video/mp4 but when I use other peoples link the protocol is MP4. I have copied all the headers and I am MemoryStream to pass the file.

Here is what I am trying to copy.

enter image description here

Here is my current copy enter image description here Andrew

Andrew
  • 173
  • 1
  • 1
  • 8
  • http has special characters the will be in binary data. So you have to use Convert.ToBase64String(byte[] Array); which what ftp uses in binary mode. – jdweng Dec 11 '18 at 13:30
  • Did not seem to make any difference. – Andrew Dec 11 '18 at 14:01
  • Is the protocol "MP4" in the http headers or is it in the header of the mp4 binary file? Are the working service http 1.0 or 1.1? What status are you getting in the response (200 Done)? – jdweng Dec 11 '18 at 15:26
  • I added images of the pcap. You can see my return media type is video/mp4 where the image I am trying to copy is MP4 – Andrew Dec 11 '18 at 20:37
  • The media type is in the MP4 file and not part of the http request. I don't think that is why it is failing. As you can see it is chunked mode (http 1.1). It is probably failing because the response asks for Next chunk and your code isn't sending next chunk so you timeout. I've never successfully gotten chunk mode to work in Net Library. Normally what I do is in the request force stream mode 1.0 so I don't have to send next chunk message. – jdweng Dec 12 '18 at 02:02
  • Try following : HttpWebRequest request = (HttpWebRequest)WebRequest.Create("filename"); request.ProtocolVersion = HttpVersion.Version10; – jdweng Dec 12 '18 at 02:08
  • The code give an error. Maybe because I am in WCF. I did change the binding to buffered and the chunks were now removed. Video still does not play. I think the key is to get the protocol to mp4. – Andrew Dec 12 '18 at 02:20
  • That the type of of MDF file. The MDF file is binary. The methods that work do they use GZIP? The binary file need to be encoded since http has special characters that can be in the binary data. – jdweng Dec 12 '18 at 09:56
  • See : https://stackoverflow.com/questions/839888/httpwebrequest-native-gzip-compression – jdweng Dec 12 '18 at 14:23
  • OK, You are correct. The file I was sending was mp2t but once I changed the video format the correct mp4 was sent. Looks like my issue was the MPF file having the wrong codec. – Andrew Dec 12 '18 at 14:50

0 Answers0