Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > Video stream recording
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 08-22-2012, 02:34 AM
wer783 wer783 is offline
Junior Member
 
Join Date: Apr 2011
Posts: 25
wer783 is on a distinguished road
Default

trying to download a ts packet using command line


I would like to capture a TS packet using a command line method so that I can automate downloading the entire stream.

Here's an example packet from nbcolympics.com. It is a 5-second transport stream packet.

http://r2---dfw06s22.c.youtube.com/v...es&file=seg.ts

I can open this link in VLC player and it will play or let me save it to disk. I can also open it in a web browser and save it to disk. I cannot figure out any way to do it using command line. I tried to do it with VLC's command line options but it says it cannot be opened.

Can anyone give me an example command line string, using any program, to do this?

Last edited by wer783 : 08-22-2012 at 10:25 PM.
Reply With Quote
  #2  
Old 08-22-2012, 02:42 PM
nwtim nwtim is offline
Member
 
Join Date: Aug 2012
Posts: 59
nwtim is on a distinguished road
Default

Re: trying to download a ts packet using command line


I've found no easy way to do this yet, but I haven't had a lot of time to put into it. As for getting all the 5-second file segments, a really easy way to do it is with Streaming Video Recorder (apowersoft), but it can't join the files. I've explained this challenge to their support and they say they're working on it and it will be in the next version.

VLC can play the entire folder of these crystal clear files, but there's a short pause at the end of each segment before the following one plays. Perhaps VLC has a way of exporting the playing of this sequential playlist to a file(?).
Reply With Quote
  #3  
Old 08-22-2012, 04:01 PM
chap chap is offline
Senior Member
 
Join Date: Feb 2011
Location: Ukraine
Posts: 1,165
chap is on a distinguished road
Default

Re: trying to download a ts packet using command line


Quote:
VLC can play the entire folder of these crystal clear files, but there's a short pause at the end of each segment before the following one plays. Perhaps VLC has a way of exporting the playing of this sequential playlist to a file(?).
simple use ffplay(ffmpeg)
Reply With Quote
  #4  
Old 08-22-2012, 04:14 PM
wer783 wer783 is offline
Junior Member
 
Join Date: Apr 2011
Posts: 25
wer783 is on a distinguished road
Default

Re: trying to download a ts packet using command line


Thanks for the information on Streaming Video Recorder. I tried it out and was able to get it to give me a bunch of pieces. The only problem is that it just grabs what is currently playing and so there's not any way to automate the process. So it's not any better than using ffmpeg to capture the stream by reading the m3u8 playlist file described in the big nbcolympics.com thread. But I like that program because I have been using GetFlv for a long time and thought it was the only game in town. It looks like this program will do similar things.

By the way, anyone reading this who just wants an easy way to capture videos from nbcolympics.com should see this thread: http://stream-recorder.com/forum/cap...om-t13287.html

It's explained very well there and is easy to do. The only reason I'm trying to directly download each 5-second segment is that the connections will usually timeout before I can download an entire video. It usually takes a lot of tries to get the full video. Some of the longer ones, like the ones that are 7 hours long, I've been uanble to get.

I've tried to use wget and VLC command line and they don't work, but it's really easy to download these segments if you just paste the link in VLC player or a web browser. But this would take forever and wouldn't be practical. deadmund seemed to have figured out how to download individual packets this with VLC player from a script, but has still not come back to explain. It seems like there should be some way to do this, given that it's so easy to do with a GUI.
Reply With Quote
  #5  
Old 08-22-2012, 06:38 PM
nwtim nwtim is offline
Member
 
Join Date: Aug 2012
Posts: 59
nwtim is on a distinguished road
Default

Re: trying to download a ts packet using command line


Quote:
Originally Posted by chap View Post
Quote:
Originally Posted by nwtim View Post
...
VLC can play the entire folder of these crystal clear files, but there's a short pause at the end of each segment before the following one plays. Perhaps VLC has a way of exporting the playing of this sequential playlist to a file(?).
simple use ffplay(ffmpeg)
Please explain. Can ffmpeg/ffplay join all these files into one? What switches would I use?
Reply With Quote
  #6  
Old 08-22-2012, 06:53 PM
nwtim nwtim is offline
Member
 
Join Date: Aug 2012
Posts: 59
nwtim is on a distinguished road
Default

Re: trying to download a ts packet using command line


Quote:
Originally Posted by nwtim View Post
Please explain. Can ffmpeg/ffplay join all these files into one? What switches would I use?
I see something about concatenating multiple files into one in para. 3.14.2 on this page. I can't imagine having to join thousands of files using this method - yikes! There must be an easier way.

BTW, if I use ffmpeg to capture the file, is there a simple way to record a 4 hour video in 30 minute segments?
Reply With Quote
  #7  
Old 08-22-2012, 10:23 PM
wer783 wer783 is offline
Junior Member
 
Join Date: Apr 2011
Posts: 25
wer783 is on a distinguished road
Default

Re: trying to download a ts packet using command line


Quote:
Originally Posted by nwtim View Post
Please explain. Can ffmpeg/ffplay join all these files into one? What switches would I use?
The method in the thread above doesn't involve concatenating files. First, do this (copied from MrPaul's post in that thread):

•Start Firefox
•Open web console (CTRL-SHIFT-K)
•Optional - Unselect CSS, JS, & Logging on the menu bar
•Type in "m3u8" in the filter on top right
•Start the video you want to see
•Click the gear icon on bottom right of video and select the quality you want (typically 1080) and you'll see a new m3u8 file appear
•Use this URL for the "-i" option of ffmpeg

The m3u8 file is a playlist that contains all those small files. Next, what you do is run this command, where URL is the m3u8 playlist file and output.ts is the name of the output video file:

ffmpeg.exe -i URL -c copy output.ts
Reply With Quote
  #8  
Old 08-23-2012, 01:47 AM
nwtim nwtim is offline
Member
 
Join Date: Aug 2012
Posts: 59
nwtim is on a distinguished road
Default

Re: trying to download a ts packet using command line


Quote:
Originally Posted by wer783 View Post
The method in the thread above doesn't involve concatenating files. First, do this (copied from MrPaul's post in that thread):

•Start Firefox
•Open web console (CTRL-SHIFT-K)
•Optional - Unselect CSS, JS, & Logging on the menu bar
•Type in "m3u8" in the filter on top right
•Start the video you want to see
•Click the gear icon on bottom right of video and select the quality you want (typically 1080) and you'll see a new m3u8 file appear
•Use this URL for the "-i" option of ffmpeg

The m3u8 file is a playlist that contains all those small files. Next, what you do is run this command, where URL is the m3u8 playlist file and output.ts is the name of the output video file:

ffmpeg.exe -i URL -c copy output.ts
That's what I'm doing. I was just hoping there was a way to avoid the time involved in getting all that video all over again. Oh well, I guess I'll just batch record them over the next few nights. I wonder how long the NBCOlympics site will continue to host those videos?
Reply With Quote
  #9  
Old 08-23-2012, 02:31 PM
wer783 wer783 is offline
Junior Member
 
Join Date: Apr 2011
Posts: 25
wer783 is on a distinguished road
Default

Re: trying to download a ts packet using command line


Quote:
Originally Posted by nwtim View Post
That's what I'm doing. I was just hoping there was a way to avoid the time involved in getting all that video all over again. Oh well, I guess I'll just batch record them over the next few nights. I wonder how long the NBCOlympics site will continue to host those videos?
You can download the m3u8 file and edit it so that you only download part of the video. You would delete the files in the playlist that you don't want to play. For example, you might leave only 500 files in a playlist. Then you'd cat the ffmpeg output files together with ffmpeg. I tested this method awhile back and it works perfectly and it's the way I'll be doing it if I can't figure out a way to download each segment individually.

If anyone has any ideas how to download each segment individually, I would still like to know how to do it. I have an idea which I haven't tried yet. Use a download manager. I haven't used one in a long time, not since I was using dial-up. I remember being able to use a pretty advanced download list with GetRight, so maybe it would work.

The reason I want to get the segments individually is that you have the most options when you get the raw data. Since it's trivial to cat ts files together (just use a binary file combiner), there's no disadvantage to doing it this way, and if you have raw data you can fix problems. For example, in one stream on nbcolympics.com, there's some bad data that would easily be fixable but causes ffmpeg to make the audio go out of sync. I can fix this in the raw data files I've downloaded of that stream. And I'm not really doing this just to get the Olympics. I all ready have everything I really wanted from the Olympics. I assume I will be able to use what I find out in the future for other things.
Reply With Quote
  #10  
Old 08-26-2012, 05:15 PM
thankyousuperman thankyousuperman is offline
Junior Member
 
Join Date: Aug 2012
Posts: 1
thankyousuperman is on a distinguished road
Default

Re: trying to download a ts packet using command line


Quote:
Originally Posted by wer783 View Post
You can download the m3u8 file and edit it so that you only download part of the video. You would delete the files in the playlist that you don't want to play. For example, you might leave only 500 files in a playlist. Then you'd cat the ffmpeg output files together with ffmpeg. I tested this method awhile back and it works perfectly and it's the way I'll be doing it if I can't figure out a way to download each segment individually.

Just registered to say: Wow, that worked for me. I had to learn a bit about m3u syntax first in order to know exactly what to truncate in the modified m3u8 file, but after that it was smooth sailing. Saved the modified m3u8 to my hard drive and opened it in ffmpeg which started saving it right away. I'd previously used -ss and ffmpeg would go through the entire playlist before saving what I wanted, and by that time the link expired. Editing m3u8 is the way to go with really long videos.

Thanks again!
Reply With Quote
Reply Post New Thread
Tags:



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:51 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons