I am doing some experimenting with very basic MP4 video streaming using the HTML5 video tag.
Upon looking at the headers that are sent from the client (Chrome browser) when I go to the page with the video tag on it, I see three different range headers sent to the server:
range: 'bytes=0-'
range: 'bytes=4489216-'
range: 'bytes=1180401664-'
I am wondering why Chrome is not specifying an end range header to accompany the start range, it looks like Chrome is attempting to load the entire file, then asking for data somewhere a bit further in the file, and then asking for data very close to the end of the file.
When looking at the Chrome developer tools in the network tab, I see that it immediately download about 3 MB once I get to the page with the video tag on it, then about 20 kB, and then about 3 MB again near the very end of the file.
Streaming does seem to work like this as well as scanning through the video but I'm mainly wondering about why there are no end ranges specified by Chrome and also why it is downloading seemingly random points and sizes in the video while visiting the page.
Thanks!
There is no end because it doesn't not know the end. Mp4 files are split into "boxes". The first 4 bytes of each box is the box size. So the player knows where the next box starts But it doest know the next box size until it starts to download it. So it leapfrogs through the file until it finds what it needs. The browser can always just close the socket if it decides it doesn't want the rest of the range.
Related
I'm trying to get a 360 streamed video to play at its full (4k) resolution. I did do previous searching and found the below thread but it didn't answer my question.
How do I adjust the video resolution?
My end goal is to integrate this into vlc unity but I also don't see how to adjust the resolution up to 4k (or higher) for streamed videos even on the desktop app. As a test, I tried a 4k video from youtube in the VLC desktop app and couldn't see how to get it to play in 4k. The end goal is to stream from aws but I want to confirm that my stream can indeed play at 4k before continuing to try to figure out why it's playing at lower resolution within Unity. It resizes down to 1920x1080 instead of the intended 4096x2048 for my aws stream and resizes the youtube video down to 1280x720 from its 3840x2160.
I've tried messing with the advanced settings and looking at input/codecs and the best option for "preferred video resolution" is "best available" (below that is full hd). I've looked through other suggestions online and didn't see a lot to change but did change Settings-->Video-->Output to "DirectX (DirectDraw) video output. This one was just me fumbling through the desktop app, but I tried going through Media-->Open Network Stream, clicking the arrow next to play and selecting stream, choosing RTSP for destination, and then editing the resolution within the profile to be a specified width and height. None of the above changed the resolution of the video.
TL;DR - How can I play a streamed video at higher resolutions (4k and up) in the VLC desktop app and in VLC Unity?
Edit - adding requested code snippets. This just modifies the UseRenderingPlugin file from the VLC unity asset.
Also, similar to what was getting discussed in the comments, when I play the video locally instead of streaming, it plays at the full resolution of the video.
Within Awake() I set the material to the 4096x2048 one mentioned for the skybox
RenderSettings.skybox = material4k;
And then in Update here is the relevant segment
var texptr = _mediaPlayer.GetTexture(out bool updated);
if (updated && texptr != IntPtr.Zero)
{
Debug.Log("Creating texture ");
tex = Texture2D.CreateExternalTexture((int)width,
(int)height,
TextureFormat.RGBA32,
false,
true,
texptr);
RenderSettings.skybox.mainTexture = tex;
}
The problem that I'm having is quite simple. I'm opening a webpage, looking for the input box where I type some text and then hit a Search button. Once the new webpage is uploaded I gather all the info I need. My problem is in the time spent uploading the webpage. My gathering code doesn't work because the new webpage is still not loaded. I have the following code to wait for that:
Do While ie.ReadyState <> READYSTATE_COMPLETE
DoEvents
Loop
where ie was set like this
Set ie = New InternetExplorer
Is there another code except the application.wait that I can use to fix this?
I've run into similar issues when attempting the same. The issue is that the ready state on the IE object can't always be trusted, or at the very least, it's not signaling what you think. For example it will let you know when each frame is ready, not the whole page. So if you don't actually need to see the web browser control, and you only care about sending and receiving data. My suggestion is to not bother rending the page in a web browser object, instead just send and receive data using a WinHttpRequest.
Tools>References>Microsoft WinHTTP Services
Using this, you can send and receive the HTML data directly. If your page uses URL parameters, you send a "GET" then parse the reply. Otherwise you will have to send a "PUT" and send the edited HTML (Basically take the blank form page you begin with and set all the values). When first using, it can be a bit tricky to get the formatting correct depending on the complexity of the page you are trying to automate. Find a good web dugging tool (such as Fiddler) so that you can see the HTML being sent to your target page.
(Warning: this link is SFW, but the site hosts NSFW text/audio content on other pages, so maybe don't click through on a work computer.)
I am trying to access a series of pages like this. Each page streams an M4A audio file. Once the page loads, the jQuery document-ready event goes and fetches the duration of the audio and puts it on the page.
That's the value I want, the contents of div.jp-duration after the JavaScript has done its insertion.
To do this, I am writing
headless = Headless.new
headless.start
browser = Watir::Browser.start "https://soundgasm.net/u/tarkustrooper/F-Wasted-Time-The-Eagles"
duration = browser.execute_script %q{return $("div.jp-duration").innerHTML}
but I'm not returned anything.
If I try $("#jquery_jplayer_1").data('jPlayer').status.duration, expecting the number of seconds, I get back 0, even though this works if I try in a Chrome console.
I'm using Watir wrong somehow, but I don't knowit well enough to know how. I'd love some help if possible.
I'm using Ruby 2.1.5, Watir 5.0.0, Watir-Webdriver 0.8.0 and Headless 2.2.0 on CentOS 6.
This should work without the need for execute_script:
#browser.div(class: 'jp-duration').text
First of all i work with Drupal 7.
I have a custom content type which allows me to upload an audio file.
I found a way to play the audio file when the user access a page of this content type.
Now i want to let the user download the audio file, but not remove the play capabilities. I want to add a download button on the same page (details page of the content type).
Can someone explain me how to do it ? I've got nowhere on this matter.
There are many ways to achieve this, depending on your drupal expertise. If you are using node templates, then you can print the same variable twice, once inside the music player plug in, and once with a download button. Something like this:
...... prints other fields .....
<my-audio-player src="<?php print $node->field_my_audio_field;?>"/>
Click to download
...... prints other fields .....
To force the download instead of opening, check this: Force browsers to download a file rather than open
To achieve this without writing any code or templates, you can do what Fleix Eve have suggested above. Set the display settings as direct download. Then create a block view which shows your audio file field, take the argument from URL. Then set tat block to display on node-view.
At my client's request I have placed a song on her website, set to run on loop using flash. The swf is tucked inside of a table in her sidebar navigation. For some reason the swf doubles, then triples, etc. at the end of each play.
I'm using Dreamweaver and Flash and have tried different combinations of parameters:
Inside Flash: loop on event, loop with stream
Inside DW: loop on and off
Does anyone have a guess as to why/what is causing the swf to stack on itself and how to fix it?
Answering my own question:
The parameter for loop needed to be set to false, as the swf itself had a loop built into it.
The correct combination is Event:Loop (within the swf) and loop "false' in DW.