Seeking in network streams

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Ortix
New Cone
New Cone
Posts: 5
Joined: 29 Sep 2014 21:39

Seeking in network streams

Postby Ortix » 14 Nov 2014 14:08

For some time now I've been trying to build a little application (which I will explain later on), and I'm trying to figure out the inner workings of decoding video. So now I'm curious how VLC handles seeking in network streams. From what I understand is that it needs some header information before it can actually render anything. But how does that work when the user skips to halfway into the video without actually downloading the whole thing?

The reason I ask is because I'm trying to build a tiny app (currently in nodejs, since CLI didn't work) which uses peerflix to stream a torrent through an http server from which I then want to take several screenshots without having to download the entire file. I can then open the stream in VLC and this is where the tricky part comes in. Apparently VLC creates a request with an http range header. So peerflix then starts downloading those parts. But how does that work? What about the header information? Is that still stored as cache in VLC? Because I tried to be smart and decided to manually download the first part of a torrent, another chunk from somewhere in the middle and tried to concat both streams. That obviously did not work.

So the background to the story is: Extract screenshots without downloading the entire file through bittorrent and automate the process

I also thought of using CLI to open the stream (which works) but when I try to take a screenshot at let's say 50%, it will download the entire thing up to 50% and then take the screenshot. Also, I couldn't get it to work on a headless linux machine where it's supposed to be, only on my windows machine it worked.

Any form of help would be appreciated! I've been researching this for some time now and I feel I get closer by the day

Rémi Denis-Courmont
Developer
Developer
Posts: 15318
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Seeking in network streams

Postby Rémi Denis-Courmont » 14 Nov 2014 16:09

How to seek depends on the file format... There are no simple answers to the question.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Ortix
New Cone
New Cone
Posts: 5
Joined: 29 Sep 2014 21:39

Re: Seeking in network streams

Postby Ortix » 14 Nov 2014 16:40

let's say it's an x264 video format

Rémi Denis-Courmont
Developer
Developer
Posts: 15318
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Seeking in network streams

Postby Rémi Denis-Courmont » 14 Nov 2014 18:51

x264 is not a video format.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Ortix
New Cone
New Cone
Posts: 5
Joined: 29 Sep 2014 21:39

Re: Seeking in network streams

Postby Ortix » 14 Nov 2014 19:55

Sorry I mean h264 encoded video in a matroska container. I was in a bit of rush with that response, excuse me :oops:


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 72 guests