Hauppauge 1212 HD PVR - problem with http streaming

*nix specific usage questions
fantforever
New Cone
New Cone
Posts: 6
Joined: 27 Jun 2011 17:42

Hauppauge 1212 HD PVR - problem with http streaming

Postby fantforever » 27 Jun 2011 18:03

Hi everybody.

I have Hauppauge 1212 HD PVR device to realtime encoding HD-stream from HD camera (I use Canon Legria HF-S21).

I have a problem to stream (with VLC) without transcoding from Ubuntu 11.04.
On remote machine I get audio stream, and video size, but screen is blank (black).

With recorded (via cat /dev/video0 > test.ts) file the same situation, it playes perfectly, but doesn't stream.

Help me, please. Maybe, somebody have another solution?

Test file recorded from HD PVR, can be downloaded here : test.ts (71Mb)

Command:

Code: Select all

#!/bin/sh mux="ffmpeg{mux=flv}" dst=":8080/video.flv" input="pvr:// :pvr-device=/dev/video1 :pvr-norm=2 :pvr-caching=1500 :file-caching=1500 :pvr-framerate=50" output=":sout=#standard{access=http,mux=$mux,dst=:8080/video.flv} :no-sout-rtp-sap :no-sout-standard-sap :ttl=128 :sout-keep" cvlc -vvvvv -I dummy $input $output

VLC log (sorry, but in CODE tag i can't highlight warnings):
[0x820352c] main access debug: looking for access module: 1 candidate
[0x820352c] pvr access debug: Using video device: /dev/video1.
[0x820352c] pvr access debug: hdpvr driver (Hauppauge HD PVR on usb-0000:00:1d.7-3) version 00.02.00
[0x820352c] pvr access debug: this driver uses the v4l2 API
[0x820352c] pvr access warning: Failed to set the requested video standard.
[0x820352c] main access debug: using access module "pvr"
[0x820352c] main access debug: TIMER module_need() : 0.330 ms - Total 0.330 ms / 1 intvls (Avg 0.330 ms)
[0x821314c] main stream debug: Using AStream*Stream
[0x821314c] main stream debug: pre buffering
[0x821314c] main stream debug: received first data after 486 ms
[0x821314c] main stream debug: pre-buffering done 1024 bytes in 0s - 2 KiB/s
[0x8212ee4] main stream debug: looking for stream_filter module: 5 candidates
[0x8212ee4] main stream debug: no stream_filter module matching "any" could be loaded
[0x8212ee4] main stream debug: TIMER module_need() : 0.114 ms - Total 0.114 ms / 1 intvls (Avg 0.114 ms)
[0x8212ee4] main stream debug: looking for stream_filter module: 1 candidate
[0x8212ee4] main stream debug: using stream_filter module "stream_filter_record"
[0x8212ee4] main stream debug: TIMER module_need() : 0.082 ms - Total 0.082 ms / 1 intvls (Avg 0.082 ms)
[0x82005e4] main input debug: creating demux: access='pvr' demux='' path=''
[0x8203b0c] main demux debug: looking for demux module: 52 candidates
[0x8203b0c] ts demux debug: PATCallBack called
[0x8203b0c] ts demux debug: new PAT ts_id=0 version=1 current_next=1
[0x8203b0c] ts demux debug: * number=0 pid=31
[0x8203b0c] ts demux debug: * number=1 pid=256
[0x8203b0c] ts demux debug: PMTCallBack called
[0x8203b0c] ts demux debug: new PMT program number=1 version=0 pid_pcr=4097
[0x8203b0c] ts demux debug: * descriptor : registration HDMV
[0x8203b0c] ts demux debug: * descriptor : unknown (0x88)
[0x8203b0c] ts demux debug: * es pid=4113 type=27 dr->i_tag=0x5
[0x8203b0c] ts demux debug: * es pid=4113 type=27 fcc=h264
[0x82005e4] main input debug: selecting program id=1
[0x8203b0c] ts demux error: MPEG-4 descriptor not found
[0x8203b0c] ts demux debug: * es pid=4352 type=15 fcc=mp4a
[0x820352c] pvr access warning: Unimplemented query in control.
[0x8203b0c] main demux debug: using demux module "ts"
[0x8203b0c] main demux debug: TIMER module_need() : 14.803 ms - Total 14.803 ms / 1 intvls (Avg 14.803 ms)
[0x82132f4] main decoder debug: looking for packetizer module: 21 candidates
[0x82132f4] main decoder debug: using packetizer module "packetizer_h264"
[0x82132f4] main decoder debug: TIMER module_need() : 1.429 ms - Total 1.429 ms / 1 intvls (Avg 1.429 ms)
[0x82132f4] main decoder debug: thread (decoder) created at priority 0 (input/decoder.c:301)
[0x82132f4] main decoder debug: thread started
[0x82539ec] main decoder debug: looking for packetizer module: 21 candidates
[0x82539ec] packetizer_mpeg4audio decoder debug: running MPEG4 audio packetizer
[0x82539ec] packetizer_mpeg4audio decoder debug: no decoder specific info, must be an ADTS or LOAS stream
[0x82539ec] main decoder debug: using packetizer module "packetizer_mpeg4audio"
[0x82539ec] main decoder debug: TIMER module_need() : 0.210 ms - Total 0.210 ms / 1 intvls (Avg 0.210 ms)
[0x82539ec] main decoder debug: thread (decoder) created at priority 5 (input/decoder.c:301)
[0x82539ec] main decoder debug: thread started
[0x8203b0c] ts demux debug: DEMUX_SET_GROUP 0 (nil)
[0x82005e4] main input debug: starting in async mode
[0x820352c] pvr access warning: Unimplemented query in control.
[0x82594dc] main demux meta debug: looking for meta reader module: 2 candidates
[0x82594dc] lua demux meta debug: Trying Lua scripts in /home/test/.local/share/vlc/lua/meta/reader
[0x82594dc] lua demux meta debug: Trying Lua scripts in /usr/lib/vlc/lua/meta/reader
[0x82594dc] lua demux meta debug: Trying Lua playlist script /usr/lib/vlc/lua/meta/reader/filename.luac
[0x82594dc] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[0x82594dc] main demux meta debug: no meta reader module matching "any" could be loaded
[0x82594dc] main demux meta debug: TIMER module_need() : 0.599 ms - Total 0.599 ms / 1 intvls (Avg 0.599 ms)
[0x82005e4] main input debug: `pvr://' successfully opened
[0x8203b0c] ts demux debug: pid[31] unknown
[0x8203b0c] ts demux debug: pid[4097] unknown
[0x82005e4] main input debug: Buffering 0%
[0x82005e4] main input debug: switching to sync mode
[0x82539ec] packetizer_mpeg4audio decoder debug: detected ADTS format
[0x82132f4] packetizer_h264 decoder debug: found NAL_SPS (sps_id=0)
[0x82132f4] packetizer_h264 decoder debug: found NAL_PPS (pps_id=0 sps_id=0)
[0x82029fc] main stream output debug: adding a new sout input (sout_input:0x82538c8)
[0x82055a4] main mux debug: adding a new input
[0x82055a4] avformat mux debug: adding input
[0x82055a4] avformat mux warning: Missing frame rate, assuming 25fps
[0x82539ec] packetizer_mpeg4audio decoder: AAC channels: 2 samplerate: 48000
[0x82029fc] main stream output debug: adding a new sout input (sout_input:0x8253180)
[0x82055a4] main mux debug: adding a new input
[0x82055a4] avformat mux debug: adding input
[0x82005e4] main input debug: Buffering 6%
[0x82005e4] main input debug: Buffering 13%
[0x82005e4] main input debug: Buffering 19%
[0x82005e4] main input debug: Buffering 26%
[0x82005e4] main input debug: Buffering 33%
[0x82005e4] main input debug: Buffering 39%
[0x82005e4] main input debug: Buffering 46%
[0x82005e4] main input debug: Buffering 53%
[0x82005e4] main input debug: Buffering 59%
[0x82005e4] main input debug: Buffering 66%
[0x82005e4] main input debug: Buffering 73%
[0x82005e4] main input debug: Buffering 79%
[0x82005e4] main input debug: Buffering 86%
[0x82005e4] main input debug: Buffering 93%
[0x82005e4] main input debug: Buffering 99%
[0x82005e4] main input debug: Stream buffering done (1599 ms in 1555 ms)
[0x82005e4] main input debug: Decoder buffering done in 0 ms
[0x82029fc] main stream output warning: trying to send non-dated packet to stream output!
....
[0x82029fc] main stream output warning: trying to send non-dated packet to stream output!
[0x82029fc] main stream output warning: trying to send non-dated packet to stream output!
[0x82055a4] avformat mux debug: writing header
[0x82029fc] main stream output warning: trying to send non-dated packet to stream output!
[0x82029fc] main stream output warning: trying to send non-dated packet to stream output!
....

^C[0x81e9904] signals interface error: Caught Interrupt signal, exiting...
[0x814d914] main libvlc debug: deactivating the playlist
[0x815c13c] main playlist debug: Deactivate
[0x815c13c] main playlist debug: incoming request - stopping current input
[0x820352c] main access debug: waitpipe: object killed
[0x815c13c] main playlist debug: dying input
[0x82005e4] main input debug: control type=0
[0x82005e4] main input debug: control: stopping input
[0x815c13c] main playlist debug: dying input
[0x82132f4] main decoder debug: removing module "packetizer_h264"
[0x82132f4] main decoder debug: killing decoder fourcc `h264', 0 PES in FIFO
[0x82029fc] main stream output debug: removing a sout input (sout_input:0x82538c8)
[0x82055a4] avformat mux debug: removing input
[0x82539ec] main decoder debug: removing module "packetizer_mpeg4audio"
[0x82539ec] main decoder debug: killing decoder fourcc `mp4a', 0 PES in FIFO
[0x82029fc] main stream output debug: removing a sout input (sout_input:0x8253180)
[0x82055a4] avformat mux debug: removing input
[0x82055a4] main mux warning: no more input streams for this mux
...

chad27295
Blank Cone
Blank Cone
Posts: 10
Joined: 28 Jan 2008 20:06

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby chad27295 » 08 Jul 2011 22:13

I think that PVR device is not putting a DTS or PTS timestamp into the transport stream. (Not sure of the terminology..someone correct me if need be) I think vlc should automatically do this if it cannot pull this info out of the stream but apparently its not. I took your test.ts and I was able to reproduce your issue by attempting to stream it in VLC. The stream just plays audio no video. I did however get it to stream correctly using ffmpeg and view it with VLC. I think ffmepg will calculate its own timing and place it into the stream somehow. Can you see if ffmpeg works and view the stream using VLC? the command line I used with your test.ts is:

ffmpeg -i test.ts -vcodec copy -sameq -acodec copy -f mpegts udp://224.1.1.1:1234

I wanted to make sure that I used -vcodec copy etc.. so ffmepg would not try to transcode the stream, of course transcoding would work but that would put too much of a load on your cpu and be unnecessary since the stream is already encoded.

to view the video using vlc :

Code: Select all

vlc udp://@224.1.1.1:1234
I think your command line for live video from your PVR would be:

Code: Select all

cat /dev/video0 | ffmpeg -i - -vcodec copy -sameq -acodec copy -f mpegts udp://224.1.1.1:1234
you should also be able to substitute to http streaming if this works, I'm just more familiar with udp.

I'm curious to know your results, I would probably pick up one of these PVRs myself if live streaming in VLC/ffmpeg would be possible without the need to transcode.

fantforever
New Cone
New Cone
Posts: 6
Joined: 27 Jun 2011 17:42

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby fantforever » 09 Jul 2011 16:38

I'm curious to know your results, I would probably pick up one of these PVRs myself if live streaming in VLC/ffmpeg would be possible without the need to transcode.
Hi!

This is awesome!

With some modifications to your code I get fully-working solution!

This is my steps to make working mechanism:

1. First of all, I bought Hauppauge 1212 HD PVR Encoder
2. Using BillGates excrement (XP) I updated firmware to version 1.5 (or 15, I don't remember). Then it was working well with Linux (XUbuntu 11.04)
3. Installed VLC, FFMPEG and other soft to make sreaming
4. There are my scripts:

To catch stream from HD PVR and to send it to localhost by UDP protocol (VERY MUCH THANKS TO chad27295)

Code: Select all

cat /dev/video0 | ffmpeg -i - -vcodec copy -sameq -acodec copy -f mpegts udp://127.0.0.1:1234
I decided to use localhost to avoid network overloading (I want to use small nettop, located near HDPVR and camera, to send http stream over 802.11N).

To receive UDP-stream from FFMpeg and send it by VLC HTTP streaming to http://*:2000

Code: Select all

cvlc -vvv udp://@127.0.0.1:1234 :sout="#http{mux=ts,dst=:2000/}" :sout-mux-caching=50 :no-sout-rtp-sap :no-sout-standard-sap :ttl=128 :sout-keep

HTOP says that this solution eats about 5% of my Atom 230. No warnings when streaming, no packet or frame loss. No "main mux warning: late buffer for mux input". Stream is very stable!
Bitrate of my video is 5Mbit (I can't test greater bitrate now because I'm at home now and my home speed limited to 4Mbps by provider)



Then, I get HTTP stream by another PC (Ubuntu 11.04, Intel i7 920, 4 physical, 8 virtual cores):

Code: Select all

vlc -vvv http://my_office_IP:2000/ :sout="#transcode{vcodec=h264,vb=1200,fps=25,width=1024,height=576}:http{mux=ts,dst=:8080/}" :sout-mux-caching=3000 :no-sout-rtp-sap :no-sout-standard-sap :ttl=128 :sout-keep
sout-mux-caching was set when I tried to use mux=ffmpeg(mux=flv), but I wasn't lucky to make such multiplexing, it worked with sout-mux-caching=3000 and more, but there was no stream. I decided to set mux=ts and it works well, but I receive this warning throughout the process:

Code: Select all

... [0x7fa514009360] main mux warning: late buffer for mux input (3493338) [0x7fa514009360] main mux warning: late buffer for mux input (3477228) [0x7fa514009360] main mux warning: late buffer for mux input (3453570) [0x7fa514009360] main mux warning: late buffer for mux input (3436717) [0x7fa514009360] main mux warning: late buffer for mux input (3423139) [0x7fa514009360] main mux warning: late buffer for mux input (3411247) [0x7fa514009360] main mux warning: late buffer for mux input (3392237) [0x7fa514009360] main mux warning: late buffer for mux input (3369578) [0x7fa514009360] main mux warning: late buffer for mux input (3347495) [0x7fa514009360] main mux warning: late buffer for mux input (3346912) [0x7fa514009360] main mux warning: late buffer for mux input (3331417) [0x7fa514009360] main mux warning: late buffer for mux input (3319791) [0x7fa514009360] main mux warning: late buffer for mux input (3300570) [0x7fa514009360] main mux warning: late buffer for mux input (3283854) [0x7fa514009360] main mux warning: late buffer for mux input (3271276) [0x7fa514009360] main mux warning: late buffer for mux input (3251276) ...
But video and audio plays well! Load of my CPU (i7 920) is about 40-50% at this settings.


So, at this step I have two unsolved problems:
1. How to make flv muxing of stream
2. How to avoid "late buffer for mux input" warning


If somebody interested in testing of this solution, he can get 2,7Mbps live stream from hdpvr->ffmpeg->vlc->http bundle from here:

Code: Select all

vlc http://195.178.199.190:2000/
To check latency you can listen the same audio stream:

Code: Select all

vlc http://discocsid.fm:8000/256
or directly at http://www.discocsid.fm

chad27295
Blank Cone
Blank Cone
Posts: 10
Joined: 28 Jan 2008 20:06

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby chad27295 » 13 Jul 2011 15:06

I'm not sure if this is what you are trying but here are a few things I have tried:

Using the other streaming solution as previously posted and then trying this do you get any video?

Code: Select all

vlc udp://@224.1.1.1:1234 -vv --extraintf logger --sout-mux-caching=0 --sout "#transcode{vcodec=h264,acodec=mp3,samplerate=44100,vb=2400,vfilter=canvas{width=540,height=380},soverlay}:http{mux=ffmpeg{mux=flv},dst=localhost:1234/stream.flv}" --sout-all --sout-keep
and to watch I used:

Code: Select all

vlc http://localhost:1234/stream.flv
From this I got video but no audio. I tried the sample rate 48000 but it complained about flv needing 44100 from the source. I will try more options on this later if you don't figure it out before I do. It took several tries to get this to work. I think because the test.ts stream I got from you is too short by the time it fills the buffer the first vlc instance stops streaming. It also took several seconds to start playing. If you go into vlc's gui and at the top click tools > messages > and set Verbosity Level to 2 you can see it filling up the buffer before video plays. When I get my 1212 PVR I hope to find some more elegant solutions and it would be much better to test with!

I think the late buffer message is coming from the fact that the pc is having a hard time transcoding each frame in time to place it into the buffer. I thought a larger buffer would help but no such luck. If you don't transcode you should be able to stream directly into a flv mux without much of an issue other than it being a very large stream for most practical uses.

Code: Select all

vlc udp://@224.1.1.1:1234 -vv --sout-mux-caching=5000 --sout "#http{mux=ffmpeg{mux=flv},dst=localhost:1234/stream.flv}" --sout-all --sout-keep
again to watch:

Code: Select all

vlc http://localhost:1234/stream.flv
This time I can see video and hear audio ok.

mohawk24
Blank Cone
Blank Cone
Posts: 11
Joined: 21 Mar 2012 16:18

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby mohawk24 » 30 Mar 2012 17:53

Hi i also have an hd-pvr that im trying to get to stream multicast i have used the command line

cat /dev/video1 | ffmpeg -i - -vcodec copy -sameq -acodec copy -f mpegts udp://239.16.6.6:1234

as stated however i still get the warning
main stream output warning: trying to send non-dated packet to stream output!

any help would be extremely appreciated.

videofreak
New Cone
New Cone
Posts: 2
Joined: 08 Nov 2012 22:43

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby videofreak » 08 Nov 2012 22:50

Hi

I have the hauppauge 1212 HD PVR and currently i'm using the crappy "totalmedia xtreme" to record video. Can you guys/girls help me on how to just record with VLC (command line or GUI)?
I want to record a video within a limited time frame, let's say a movie of 3hours I only want to record 3 hours and then stop.

I'm just a beginner with VLC.

Can anybody of you guys/girls help me out?

Thanks in advance.

VideoFreak

fantforever
New Cone
New Cone
Posts: 6
Joined: 27 Jun 2011 17:42

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby fantforever » 09 Nov 2012 00:43

Hi.

Sometimes VLC can't recognize HD PVR header, so the best way is to use ffmpeg as bridge between HD PVR and VLC.

For example, next command plays video from HD PVR:

Code: Select all

cat /dev/video0 | ffmpeg -i - -vcodec copy -acodec copy -f mpegts | vlc -
If You want to record video, you can use both ffmpeg and vlc for this purpose, for example:

Code: Select all

cat /dev/video0 | ffmpeg -i - -vcodec copy -acodec copy -f mpegts > ~/recorded_stream.mpegts
If stream from HD PVR stops, recording will be stopped too. But you can use any solution to stop recording, starting with Ctrl+C, ending with cron job or any control software.

videofreak
New Cone
New Cone
Posts: 2
Joined: 08 Nov 2012 22:43

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby videofreak » 10 Nov 2012 20:01

Hi fantforever,

I'm currently running VLC, ffmpeg I need to install, on a windows 7 machine (bill gates garbage :lol: ).

So if possible I would like to run these commands in Windows (DOS). If not possible i'll need to install ubuntu, which i've done a time ago but i couldn't get my mousepad driver running properly...

Afterwards i would also like to apply a "commercial cutter software".

Thx in advance.

VideoFreak

fantforever
New Cone
New Cone
Posts: 6
Joined: 27 Jun 2011 17:42

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby fantforever » 10 Nov 2012 20:28

Sure you can use VLC on Windows platform to record from Hauppauge.

I recommend to run VLC GUI mode, and go to menu Media:Convert/Save.
There you can choose capture device in tabs, and that's all, if you're lucky you'll get file.

Remember that you should have installed drivers for HD PVR, and suitable codecs (I recommend x264 for video and MP3 or AAC for audio), if you need to transcode stream before saving it.

Remember that VLC use ffmpeg to transcode stream, so you should have ffmpeg installed.

I suggest to run VLC from "cmd" window, with option -vvvvv (very very very very verbose) :)
In this case you will have ability to see all errors or warnings.

Good luck.

wanted99
New Cone
New Cone
Posts: 4
Joined: 30 Mar 2014 10:16

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby wanted99 » 30 Mar 2014 10:20

direct streaming without ffmpeg

vlc -vvv pvr:///dev/video0 :bitrate=7000000 :maxbitrate=8000000 :sout="#http{mux=ts,dst=:2000/}" :sout-mux-caching=5000 :no-sout-rtp-sap :no-sout-standard-sap :ttl=128 :sout-keep



connect at http://ip:2000

wanted99
New Cone
New Cone
Posts: 4
Joined: 30 Mar 2014 10:16

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby wanted99 » 30 Mar 2014 10:51

vlc -vvv pvr:///dev/video0 :bitrate=7000000 :maxbitrate=8000000 --sout '#standard{access=udp,mux=ts,dst=239.16.6.6:1234}' --ttl 1 --cr-average 10000

wanted99
New Cone
New Cone
Posts: 4
Joined: 30 Mar 2014 10:16

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby wanted99 » 18 Nov 2014 17:28

My streaming stop after 13 hours. Who know how streaming more then 13 hours ?

same problem on 3 Hauppauge HDPVR.

it's a Mux TS problem ?

Thanks

fantforever
New Cone
New Cone
Posts: 6
Joined: 27 Jun 2011 17:42

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby fantforever » 18 Nov 2014 17:32

As I remember (topic started more than 3 years ago), it's a problem with device. It seems to be a variable overflow in hardware sources, or something like this.

We don't use HD PVR at all now, only Blackmagic devices, but trying to move forward to more specialized video capture devices, because BM have problems too (not in HW but in features)

wanted99
New Cone
New Cone
Posts: 4
Joined: 30 Mar 2014 10:16

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby wanted99 » 10 Dec 2014 18:59

Ya, maybe.

i Know it's a Timestamp overflow issue but im not sure if it cause by hardware.

i have found limitation by demux:

The new RTP demux causes a clock warp when the RTP timestamp wraps. This breaks non-TS payloads (on average every 232/freq = 13 hours).

at https://trac.videolan.org/vlc/query?pag ... escription

Maybe solution exist with old version of vlc or another way to reset RTP timestamp on TSMPEG mux.

Thanks you for your comment and you help.

prog-amateur
New Cone
New Cone
Posts: 6
Joined: 06 Mar 2015 21:22

Re: Hauppauge 1212 HD PVR - problem with http streaming

Postby prog-amateur » 12 Mar 2015 00:29

Hi, I bought an HD PVR and I really don't know how to proceed to watch TV (I pugged HD-PVR on my TV decoder to stream TV-decoder on my computer) .
It's incredible how it is difficult to set it up ! In Windows, just download the software, click play and it works... I really need you help as I prefer Ubuntu !
Thank you !


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 15 guests