LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-30-2015, 03:42 AM   #1
pchristy
Senior Member
 
Registered: Oct 2012
Location: South Devon, UK
Distribution: Slackware
Posts: 1,119

Rep: Reputation: Disabled
VLC and streaming to file


I've asked this question over on the VLC forums to no avail! I'm hoping someone here might know the answer (Eric?)!

System: Slackware64-current
Kernel: 4.1
VLC: 2.2.1 from the Alien restricted repository
System: Intel Haswell using libva-1.5.1 (vaapi)
Video capture: PCTV dongle (292e)

Problem: The driver for the 292e seems to have issues tuning the HD digital channels in the UK (DVB-T2). Only dvbv5-scan and VLC will identify the HD channels correctly. Kaffeine (my old standby) will only tune the SD channels. None of the currently available TV apps seem to support dvbv5 tuning info, so I'm stuck with VLC.

I'm trying to implement a VPR, so that I can set an at or cron job to record a channel at a certain time and stream the output to a file from the command line. Although google finds several methods of doing this, they all seem to be for older versions of VLC, and it would appear the syntax has changed.

Recording works fine from the gui, so it ought to be possible from the command line. The nearest I've got to success is doing this:
Code:
cvlc dvb-t2://frequency=538200000:bandwidth=8:program=1 --sout=file/ts:Videos/record/test.ts --run-time=30 vlc://quit
This appears to run correctly, and creates the "test.ts" file, but the file is always zero length! I've tried many variations on this, all with the same result.

One of the developers over on the VLC forum suggested "using the last page of the gui wizard" to capture what the gui does to record, but there is no wizard on my systems - it appears to exist solely on the windows version! Setting the "messages" tool to debug similarly provides no useful information as to what the gui is doing, neither does running vlc from the command line with -vvv.

I'm now stumped! Has anyone got this to work with a recent version of VLC? Am I doing something wrong or is VLC broken?

TIA,

--
Pete
 
Old 08-31-2015, 12:13 PM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
check it out http://images.videolan.org/doc/vlc-u...r-guide-en.pdf

Last edited by Drakeo; 08-31-2015 at 12:39 PM.
 
Old 08-31-2015, 12:37 PM   #3
pchristy
Senior Member
 
Registered: Oct 2012
Location: South Devon, UK
Distribution: Slackware
Posts: 1,119

Original Poster
Rep: Reputation: Disabled
Thanks for the pointer, but I've been through all of that - tried every permutation and combination I can think of, but failed to get it to work! Most of it is concerned with streaming over a network rather than to a file and/or transcoding, which I'm trying to avoid. I have found some examples of streaming to a file, but despite copying them almost verbatim (only changing locations for my machine), I STILL couldn't get it to work. I suspect that there has been a change in the syntax at some point recently, and the documentation hasn't caught up yet.

I was hoping to find someone who had actually achieved what I am attempting, but so far, no joy.

Thanks for trying, anyway!

Cheers,

--
Pete
 
Old 08-31-2015, 12:56 PM   #4
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
I think you may want to go anther direction for cron.
I would look at ussing ffmpeg
rip a dvd
Code:
ffmpeg -i concat:VTS_02_1.VOB\|VTS_02_2.VOB\|VTS_02_3.VOB\|VTS_02_4.VOB\|VTS_02_5.VOB -map 0:v:0 -map 0:a:0 -codec:a libvo_aacenc -ab 128 -codec:v libx264 -vpre libx264-ipod640 movie.mp4
if your trying to capture your tv then record it to a media file such as dot .ts .mp4 etc.
not sure what your saying but if your recording with mythTV . because the cron for that been out a long time.
https://www.mythtv.org/wiki/Transcode_cron_job
where are you grabing your data from the net work or your dvice to the tv. because that command line right.
I do media everyday.
and if you keep it simple. data in convert data out.
when i ran the command it is a demuxer problem and that leads me to a syntax problem. I do not try to record from a private net so kinda lost.
if you want to cron a youtube with vlc and recorde it.
Code:
You can use two cron lines like this to make a ~10 minute recording from 0755.

55 7 * * 1-5  cvlc --run-time=5 --sout file/ts:stream.mp4 htsp://@ip:9982/211
5  8 * * 1-5  sh -c "killall cvlc; cp stream.mp4 /path/to/upload"

Last edited by Drakeo; 08-31-2015 at 01:12 PM. Reason: wonder
 
Old 08-31-2015, 01:12 PM   #5
pchristy
Senior Member
 
Registered: Oct 2012
Location: South Devon, UK
Distribution: Slackware
Posts: 1,119

Original Poster
Rep: Reputation: Disabled
You might have triggered a thought there. I don't think ffmpeg on its own can handle a dvb tuner, but I think I've read somewhere about streaming vlc out through ffmpeg using the transcode function. Perhaps if I can get vlc to send its stream to ffmpeg, and set ffmpeg to copy.......?

Sounds like a possible route! I shall investigate! Its going to make for a VERY complex command line, though!

It used to be so much easier before HD tv came along! Kaffeine used to have all this functionality built in, without having to faff about with command line and at or cron jobs. Unfortunately, even the latest version of kaffeine, built on VLC, can't tune the HD channels - only SD! Grrrrrr!

And I'm still convinced that something has changed in recent VLC, because all the documentation suggests that what I'm attempting should be easily possible.......

Thanks again for your input!

--
Pete
 
Old 08-31-2015, 01:13 PM   #6
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
have you tried livestreamer.
http://docs.livestreamer.io/

Last edited by Drakeo; 08-31-2015 at 01:14 PM.
 
Old 08-31-2015, 01:17 PM   #7
pchristy
Senior Member
 
Registered: Oct 2012
Location: South Devon, UK
Distribution: Slackware
Posts: 1,119

Original Poster
Rep: Reputation: Disabled
From what I can see, livestreamer is for getting stuff INTO media players like VLC. I can get the DVB-T2 channels IN ok. What is bugging me is getting them OUT! I can do it from the GUI, so I know its possible. I just can't figure out the syntax to do the same from the command-line!

--
Pete
 
Old 08-31-2015, 01:28 PM   #8
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
according to this
Quote:
--run-time=30 vlc://quit
that is supposed to be a location of the youtube.
Quote:
--sout file/ts:stream.mp4 htsp://@ip:9982/211
so you run the program
Code:
cvlc --run-time=5
that tells it how long.
but I do not see where your recording from

Last edited by Drakeo; 08-31-2015 at 01:30 PM.
 
Old 08-31-2015, 01:50 PM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by pchristy View Post
You might have triggered a thought there. I don't think ffmpeg on its own can handle a dvb tuner, but I think I've read somewhere about streaming vlc out through ffmpeg using the transcode function. Perhaps if I can get vlc to send its stream to ffmpeg, and set ffmpeg to copy.......?

Sounds like a possible route! I shall investigate! Its going to make for a VERY complex command line, though!

It used to be so much easier before HD tv came along! Kaffeine used to have all this functionality built in, without having to faff about with command line and at or cron jobs. Unfortunately, even the latest version of kaffeine, built on VLC, can't tune the HD channels - only SD! Grrrrrr!

And I'm still convinced that something has changed in recent VLC, because all the documentation suggests that what I'm attempting should be easily possible.......

Thanks again for your input!

--
Pete
What about instead of ffmpeg, you try mencoder? I think it should have all the same inputs as mplayer, which should include a tuner. Then you wouldn't need to pipe from vlc to ffmpeg. I'd have no idea where to even start with a command, but it might help you to trigger more thoughts
 
Old 08-31-2015, 02:34 PM   #10
pchristy
Senior Member
 
Registered: Oct 2012
Location: South Devon, UK
Distribution: Slackware
Posts: 1,119

Original Poster
Rep: Reputation: Disabled
From my original post:
Code:
cvlc dvb-t2://frequency=538200000:bandwidth=8:program=1
tunes VLC to the right channel, and selects the correct programme on the multiplex. I know this works, because it works OK if I use vlc instead of cvlc (the command line version).

The next bit:
Code:
--sout=file/ts:Videos/record/test.ts
tells it to stream the output to a file, in mpeg-ts format, with a file name of test.ts in the Videos/record folder.

Finally:
Code:
--run-time=30 vlc://quit
tells it to run for 30 seconds and then quit.

1 & 3 work perfectly. The second snippet creates a file test.ts in the folder, but there is nothing in it - it is zero length! I've also tried all the long-winded command line options, such as:
Code:
--sout '#duplicate{dst=display}:std{access=file,mux=ts,dst=test.mts}'
and all sorts of permutations and combinations, but all I ever get is a zero length file! Not even any error messages!

I did find a youtube video which suggested setting the messages log to debug, running vlc from the gui, doing whatever you wanted to do and the parsing the messages file for the relevant commands. I tried that too, but could find no trace of --sout, record, or test.ts anywhere in the log. Yet vlc had done exactly what was requested!

At which point I started posting requests for help, having exhausted my brain!

You are the only person to respond - for which I am grateful! - other than a vlc developer, who suggested a solution that only works on windows!!! (I'm using AlienBob's package, and there is no gui wizard in that. Apparently the gui wizard only exists in the windows version!)

Its getting late now, but when I get chance, I'll investigate running vlc through ffmpeg. Its a very long-winded way of doing what VLC claims to be able to do on its own, but other than offering a blood sacrifice of my firstborn, I don't know what else to try!!!

P.S. I've switched from MPlayer to mpv, a fork which has better support for VAAPI, which my desktop uses. But MPlayer also requires a program to produce the tuning file. Only w-scan produces an MPlayer compatible file, and that won't detect the HD channels here in the UK. dvbv5-scan DOES correctly detect the HD channels, but none of the available apps that I've found are compatible with the dvbv5 channel table format. And dvdb5_scan won't produce mplayer or kaffeine compatible files! VLC doesn't need a scan table, and DOES work with the UK HD channels, but seems unable to stream them to a file!

DVB on Linux is a mess!

--
Pete

Last edited by pchristy; 08-31-2015 at 02:43 PM.
 
Old 09-04-2015, 07:58 AM   #11
pchristy
Senior Member
 
Registered: Oct 2012
Location: South Devon, UK
Distribution: Slackware
Posts: 1,119

Original Poster
Rep: Reputation: Disabled
Well I've finally solved the problem - by NOT using VLC! I have to say that I always seem to get issues with VLC - on my desktop it doesn't play nicely with VAAPI (Intel graphics), and even on my laptop (ati gfx, open source drivers and VDPAU) it is quite resource hungry compared to mpv/smplayer.

Anyway, after a lot of faffing about, I discovered that dvbv5-zap does EXACTLY what I want with minimal overheads. Took me a while to figure out the syntax, but this does what I want:
Code:
dvbv5-zap --lna=1 -c dvb/StocklandHillv5.conf "BBC ONE HD" -r -o path/to/record.mts
where "--lna=1" sets the front end amplifier to "on" for my usb dongle and StocklandHillv5.conf is the "channels.conf" file for my local transmitter, as created by dvbv5-scan. I can also monitor the signal as it comes in with:
Code:
mpv /dev/dvb/adapter0/dvr0
So now I'm nearly there! I can start to record a channel at a specific time with either at or cron. All I need to do is figure out how to stop it after a set duration, before it fills up the disk.....

--
Pete
 
Old 09-16-2015, 12:18 AM   #12
lazardo
Member
 
Registered: Feb 2010
Location: SD Bay Area
Posts: 270

Rep: Reputation: Disabled
Quote:
Originally Posted by pchristy View Post
...
So now I'm nearly there! I can start to record a channel at a specific time with either at or cron. All I need to do is figure out how to stop it after a set duration, before it fills up the disk.....
Code:
dvbv5-zap & ( sleep 61m; pkill -f "BBC ONE HD" )
where "BBC ONE HD" is unique to the particular dvbv5-zap command line as seen in /proc/PID/cmdline, and assuming that dvbv5-zap handles SIGTERM correctly.

Cheers,
 
Old 09-16-2015, 02:25 AM   #13
pchristy
Senior Member
 
Registered: Oct 2012
Location: South Devon, UK
Distribution: Slackware
Posts: 1,119

Original Poster
Rep: Reputation: Disabled
Hi Lazardo, and thanks for the tip. Another way of doing it, which works well, is
Code:
timeout 35m dvbv5-zap --lna=1 -c dvb/StocklandHillv5.conf "BBC ONE HD" -r -o Videos/record/recorded_prog.mts
where "timeout 35m" sets the record duration to 35 mins.

More than one way to skin a cat, it appears!

--
Pete
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VLC streaming realtime baronobeefdip Linux - Software 3 02-19-2015 11:59 AM
[SOLVED] video streaming support with VLC(?) as the streaming server wachi Linux - Embedded & Single-board computer 3 03-28-2011 12:35 PM
VLC error: VLC could not open the file "/usr/share/vlc/skins2/text.bmp". brjoon1021 Ubuntu 1 01-14-2009 10:48 PM
VLC streaming? Raveolution Linux - General 14 03-07-2007 06:24 PM
Streaming with vlc? Fredde87 Linux - Software 0 09-04-2005 07:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration