Hi, I have a Hauppauge PVR-HD which works but creating an h264 ts stream from a set HD component inputs and does quite a nice job of it.
The ts stream is available on /dev/video0 and a simple cat /dev/video0
file.ts will create a watchable high quality dump..
I have got this working with freevo (after a little hacking) but would prefer to get the input into vdr as I can then watch it around the house through streaming.
Using vdr-iptv I can get some of the way, but not all of it.. Playing around with different options I get either jerky video or ffmpeg just stops transcoding after a few seconds, and I'm not sure why...
I can put a 2 minute ts stream somewhere if it would help but I think it will decode a file before decoding from /dev/video0
Hauppuage-test;IPTV:1000:IPTV|S0P0|EXT|hauppauge.sh|951:P:0:256:257:0:0:1000:1:1:0
more /tmp/iptvstream
Script started 951 4321 Getting new URL /dev/video0 Change Channel to 951 on Cable Box starting with node: 1 node 1: vendor_id = 0x000024a0 model_id = 0x0000ea05 AV/C Command: 951 = Op1=0x00487C29 Op2=0x00487C25 Op3=0x00487C21 Streamsvideo.sh PID is 14632 Streamdev Plugin 951 /dev/video0 pid of ffmpeg.streamdev 14639 14632 FFmpeg version SVN-r21686, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Feb 7 2010 22:27:31 with gcc 4.3.3 configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-static --enable-shared --cc=i686-pc-linux-gnu-gcc --d isable-debug --disable-ffplay --enable-libx264 --enable-libxvid --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-x11grab --enable-pth reads --disable-altivec --cpu=athlon-fx --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-avfilter-lavf --disable-stripping --ena ble-hardcoded-tables --disable-doc libavutil 50. 9. 0 / 50. 9. 0 libavcodec 52.52. 0 / 52.52. 0 libavformat 52.51. 0 / 52.51. 0 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.17. 0 / 1.17. 0 libswscale 0.10. 0 / 0.10. 0 libpostproc 51. 2. 0 / 51. 2. 0 [mpegts @ 0x807a3a0]max_analyze_duration reached [mpegts @ 0x807a3a0]Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 119.88 (120000/1001) -> 59.94 (60000/1001) Input #0, mpegts, from '/dev/video0': Duration: N/A, start: 0.387044, bitrate: 169 kb/s Program 1 Stream #0.0[0x1011]: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 59.92 fps, 59.94 tbr, 90k tbn, 119.88 tbc Stream #0.1[0x1100]: Audio: aac, 48000 Hz, 2 channels, s16, 169 kb/s [mpegts @ 0x85f2a80]calculated bitrate 2293687 bps, muxrate 2293687 bps, sdt every 762, pat/pmt every 152 pkts Output #0, mpegts, to 'udp://127.0.0.1:4321?pkt_size=32712': Stream #0.0, 1/90000: Video: mpeg2video, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 1/25, q=2-31, 2000 kb/s, 90k tbn, 25 tbc Stream #0.1, 1/90000: Audio: mp2, 48000 Hz, 2 channels, s16, 192 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Press [q] to stop encoding [h264 @ 0x808eb00]no picture [mpegts @ 0x85f2a80]dts < pcr, TS is invalidme=1.25 bitrate=3297.2kbits/s dup=0 drop=42 frame= 146 fps= 29 q=12.2 size= 1843kB time=5.76 bitrate=2645.8kbits/s dup=0 drop=178 frame= 178 fps= 29 q=11.7 size= 2178kB time=7.03 bitrate=2537.3kbits/s dup=0 drop=244
Then it just freezes...
Any ideas?
On Mon, 8 Feb 2010, Rob Davis wrote:
[h264 @ 0x808eb00]no picture [mpegts @ 0x85f2a80]dts < pcr, TS is invalid
Then it just freezes...
Does the ffmpeg command work on the commandline? Might be related to the ffmpeg revision... Anyway, you could give a try for the FILE input protocol as it should be quite perfect for your TS source.
BR, -- rofa
On 08/02/10 12:35, Rolf Ahrenberg wrote:
On Mon, 8 Feb 2010, Rob Davis wrote:
[h264 @ 0x808eb00]no picture [mpegts @ 0x85f2a80]dts < pcr, TS is invalid
Then it just freezes...
Does the ffmpeg command work on the commandline? Might be related to the ffmpeg revision... Anyway, you could give a try for the FILE input protocol as it should be quite perfect for your TS source.
After a little investigation, it looks like it's an issue of ffmpeg reading directly off the /dev/video0 device. It looks like it gets ahead of itself. If I cat /dev/video0 to a file, sleep 5s and then ffmpeg decode the file, it almost works..
I tried to put /dev/video0 as a file but couldn't get anything out of VDR... Saying that I'm pretty sure I removed the h264 VDR patch since coming to the US. I'm running VDR 1.6 instead of 1.7 as I know what I'm doing better with it in Gentoo..
I will record a 5 min clip and put it somewhere..
Would there be a way to watch a file and call a script? That way I can execute an external channel changer depending on parameter and then dump the output to a fifo..
As an aside, xine-vdpau (xineliboutput) didn't want to play the stream (albeit stuttering horribly) full screen - it looked like a 4:3 picture when it should have been 16:9, although xine-xv didn't have a problem..
On Mon, 8 Feb 2010, Rob Davis wrote:
I tried to put /dev/video0 as a file but couldn't get anything out of VDR... Saying that I'm pretty sure I removed the h264 VDR patch since coming to the US. I'm running VDR 1.6 instead of 1.7 as I know what I'm doing better with it in Gentoo..
Well, it seems that /dev/video0 won't output TS stream, so the FILE protocol unfortunately isn't suitable.
Would there be a way to watch a file and call a script? That way I can execute an external channel changer depending on parameter and then dump the output to a fifo..
Not at this momenta and the pvrinput plugin seems much nicer approch for this.
BR, -- rofa
Hi,
Am 08.02.2010 16:53, schrieb Rob Davis:
Hi, I have a Hauppauge PVR-HD which works but creating an h264 ts stream from a set HD component inputs and does quite a nice job of it. The ts stream is available on /dev/video0 and a simple cat /dev/video0
file.ts will create a watchable high quality dump..
Is it a cx18-based card? There a plans to integrate support for the native TS-capability of those cards in the pvrinput-plugin, but it will take some time. If you mind you can send me off-list a sample video (up to 4MB with the cat-method). I'm just working on repacking the program stream of ivtv-based cards with valid PAT, PMT and PCR, a pass through of a valid TS shouldn't be that hard. But I don't promise anything since I haven't such a card. Particulary if its controls are too different from the ivtv-ones.
regards, Lars.
I have got this working with freevo (after a little hacking) but would prefer to get the input into vdr as I can then watch it around the house through streaming.
Using vdr-iptv I can get some of the way, but not all of it.. Playing around with different options I get either jerky video or ffmpeg just stops transcoding after a few seconds, and I'm not sure why...
I can put a 2 minute ts stream somewhere if it would help but I think it will decode a file before decoding from /dev/video0
Hauppuage-test;IPTV:1000:IPTV|S0P0|EXT|hauppauge.sh|951:P:0:256:257:0:0:1000:1:1:0
more /tmp/iptvstream
Script started 951 4321 Getting new URL /dev/video0 Change Channel to 951 on Cable Box starting with node: 1 node 1: vendor_id = 0x000024a0 model_id = 0x0000ea05 AV/C Command: 951 = Op1=0x00487C29 Op2=0x00487C25 Op3=0x00487C21 Streamsvideo.sh PID is 14632 Streamdev Plugin 951 /dev/video0 pid of ffmpeg.streamdev 14639 14632 FFmpeg version SVN-r21686, Copyright (c) 2000-2010 Fabrice Bellard, et al. built on Feb 7 2010 22:27:31 with gcc 4.3.3 configuration: --prefix=/usr --libdir=/usr/lib --shlibdir=/usr/lib --mandir=/usr/share/man --enable-static --enable-shared --cc=i686-pc-linux-gnu-gcc --d isable-debug --disable-ffplay --enable-libx264 --enable-libxvid --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-x11grab --enable-pth reads --disable-altivec --cpu=athlon-fx --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --enable-avfilter-lavf --disable-stripping --ena ble-hardcoded-tables --disable-doc libavutil 50. 9. 0 / 50. 9. 0 libavcodec 52.52. 0 / 52.52. 0 libavformat 52.51. 0 / 52.51. 0 libavdevice 52. 2. 0 / 52. 2. 0 libavfilter 1.17. 0 / 1.17. 0 libswscale 0.10. 0 / 0.10. 0 libpostproc 51. 2. 0 / 51. 2. 0 [mpegts @ 0x807a3a0]max_analyze_duration reached [mpegts @ 0x807a3a0]Estimating duration from bitrate, this may be inaccurate
Seems stream 0 codec frame rate differs from container frame rate: 119.88 (120000/1001) -> 59.94 (60000/1001) Input #0, mpegts, from '/dev/video0': Duration: N/A, start: 0.387044, bitrate: 169 kb/s Program 1 Stream #0.0[0x1011]: Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 59.92 fps, 59.94 tbr, 90k tbn, 119.88 tbc Stream #0.1[0x1100]: Audio: aac, 48000 Hz, 2 channels, s16, 169 kb/s [mpegts @ 0x85f2a80]calculated bitrate 2293687 bps, muxrate 2293687 bps, sdt every 762, pat/pmt every 152 pkts Output #0, mpegts, to 'udp://127.0.0.1:4321?pkt_size=32712': Stream #0.0, 1/90000: Video: mpeg2video, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 1/25, q=2-31, 2000 kb/s, 90k tbn, 25 tbc Stream #0.1, 1/90000: Audio: mp2, 48000 Hz, 2 channels, s16, 192 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Press [q] to stop encoding [h264 @ 0x808eb00]no picture [mpegts @ 0x85f2a80]dts < pcr, TS is invalidme=1.25 bitrate=3297.2kbits/s dup=0 drop=42 frame= 146 fps= 29 q=12.2 size= 1843kB time=5.76 bitrate=2645.8kbits/s dup=0 drop=178 frame= 178 fps= 29 q=11.7 size= 2178kB time=7.03 bitrate=2537.3kbits/s dup=0 drop=244
Then it just freezes...
Any ideas?
vdr mailing list vdr@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
On 08/02/10 12:58, L. Hanisch wrote:
Hi,
Am 08.02.2010 16:53, schrieb Rob Davis:
Hi, I have a Hauppauge PVR-HD which works but creating an h264 ts stream from a set HD component inputs and does quite a nice job of it. The ts stream is available on /dev/video0 and a simple cat /dev/video0
file.ts will create a watchable high quality dump..
Is it a cx18-based card? There a plans to integrate support for the native TS-capability of those cards in the pvrinput-plugin, but it will take some time. If you mind you can send me off-list a sample video (up to 4MB with the cat-method). I'm just working on repacking the program stream of ivtv-based cards with valid PAT, PMT and PCR, a pass through of a valid TS shouldn't be that hard. But I don't promise anything since I haven't such a card. Particulary if its controls are too different from the ivtv-ones.
regards, Lars.
I spoke to Marin a little about this.. In terms of controls.. There are none that need worrying about... It doesn't have a tuner. It would be useful to have a way to control an external channel changer (which Martin nicely put in for my other pvr-500 card (for SD channels off the cable box)..
The linux module is pvrhd. Once loaded, along comes a /dev/video0 device. A cat or mplayer command on this work well.
The ts stream is dependant on what is fed to it. Ie, if your source is 1080i, then you'll get a 1080i stream, if 720p then that's what you get..
There was a quick sample on the internet, but I can also manually record something for you if you want it.. Just not sure where to leave it..
Hi Rob,
Am 08.02.2010 21:28, schrieb Rob Davis:
On 08/02/10 12:58, L. Hanisch wrote:
Hi,
Am 08.02.2010 16:53, schrieb Rob Davis:
Hi, I have a Hauppauge PVR-HD which works but creating an h264 ts stream from a set HD component inputs and does quite a nice job of it. The ts stream is available on /dev/video0 and a simple cat /dev/video0
file.ts will create a watchable high quality dump..
Is it a cx18-based card? There a plans to integrate support for the native TS-capability of those cards in the pvrinput-plugin, but it will take some time. If you mind you can send me off-list a sample video (up to 4MB with the cat-method). I'm just working on repacking the program stream of ivtv-based cards with valid PAT, PMT and PCR, a pass through of a valid TS shouldn't be that hard. But I don't promise anything since I haven't such a card. Particulary if its controls are too different from the ivtv-ones.
regards, Lars.
I spoke to Marin a little about this.. In terms of controls.. There are none that need worrying about... It doesn't have a tuner. It would be useful to have a way to control an external channel changer (which Martin nicely put in for my other pvr-500 card (for SD channels off the cable box)..
I see, I helped him with getting it into the plugin.
The linux module is pvrhd. Once loaded, along comes a /dev/video0 device. A cat or mplayer command on this work well.
I did some google search on the PVR-HD and found the module name "hdpvr" in the mythtv-wiki and in my ubuntu modules directory. What says "cat /sys/class/video4linux/video0/name" and "cat /sys/class/video4linux/video0/uevent"?
The ts stream is dependant on what is fed to it. Ie, if your source is 1080i, then you'll get a 1080i stream, if 720p then that's what you get..
Ok, "no controls" is a good thing, if the plugin only has to read from the device and hand the packets over to vdr, we can give it a try.
There was a quick sample on the internet, but I can also manually record something for you if you want it.. Just not sure where to leave it..
I would like to see some small piece of video (about 4MB) to inspect the TS structure (till now I've only dealt with MPEG2-PS/TS), my inbox has no problem with an attachment of such size. Just cat some seconds to a file and send it to me (perhaps you have to truncate it with dd if it's growing to fast but make sure I get the beginning of the file ;-)). At the next weekend I can try to integrate support for it. In particular I'm interested if the PAT and PMT is present or if I have to build them with the cPatPmtGenerator of vdr 1.7.1 and up. Will it be a problem for you to upgrade to 1.7.x (x >= 1)?
regards, Lars.
Hi Rob,
Am 08.02.2010 21:28, schrieb Rob Davis:
There was a quick sample on the internet, but I can also manually record something for you if you want it.. Just not sure where to leave it..
I received your sample and it looks like a valid TS with PAT, PMT and PCR, so the plugin has nothing else to do as to pass it through to the vdr (hopefully). As pvrinput is setting a lot of controls for the cx23415/16 based cards, I'm not sure, which is the best way. Either integrate it in pvrinput (and leave the controls as is if a hdpvr is accessed) or make a new "hdpvrinput"-plugin. In the next days I will study the source as I'm new to the pvrinput-plugin but I'm confident I can make it work.
Please provide the output of
v4l2-ctl --info --list-ctrls-menus --device=/dev/video0
after a fresh load of the module. That should give me the needed parameters/values to distinguish the cards inside the plugin. The next weekend is dedicated to you. ;-)
regards, Lars.
On Tue, 9 Feb 2010, L. Hanisch wrote:
I received your sample and it looks like a valid TS with PAT, PMT and PCR, so the plugin has nothing else to do as to pass it through to the vdr (hopefully).
In the meanwhile, one could also try out the IPTV plugin without any ffmpeg hassle by using a script that tunes the device and then simply:
cat /dev/video0 | nc -u -p ${PORT} 127.0.0.1
BR, -- rofa
On Wed, 2010-02-10 at 11:18 +0200, Rolf Ahrenberg wrote:
On Tue, 9 Feb 2010, L. Hanisch wrote:
I received your sample and it looks like a valid TS with PAT, PMT and PCR, so the plugin has nothing else to do as to pass it through to the vdr (hopefully).
In the meanwhile, one could also try out the IPTV plugin without any ffmpeg hassle by using a script that tunes the device and then simply:
cat /dev/video0 | nc -u -p ${PORT} 127.0.0.1
Most of this is extra debug output, but I've never used the nc command. The port number looks to be the same as ffmpeg would use.. The only thing that may be different is there is no packet size specified..
Getting new URL /dev/video0 Change Channel to 951 on Cable Box starting with node: 1 node 1: vendor_id = 0x000024a0 model_id = 0x0000ea05 AV/C Command: 951 = Op1=0x00487C29 Op2=0x00487C25 Op3=0x00487C21 Streamsvideo.sh PID is 32604 Streamdev Plugin 951 /dev/video0 nc -u -p 4321 127.0.0.1 no port[s] to connect to
On Wed, 2010-02-10 at 11:18 +0200, Rolf Ahrenberg wrote:
On Tue, 9 Feb 2010, L. Hanisch wrote:
I received your sample and it looks like a valid TS with PAT, PMT and PCR, so the plugin has nothing else to do as to pass it through to the vdr (hopefully).
In the meanwhile, one could also try out the IPTV plugin without any ffmpeg hassle by using a script that tunes the device and then simply:
cat /dev/video0 | nc -u -p ${PORT} 127.0.0.1
Ok, did some reading of the manual..
cat /dev/video0 | nc -vv -u 127.0.0.1 ${PORT} &
Should work..
Now says:
localhost [127.0.0.1] 4321 (rwhois) open sent 573440, rcvd 0
Then gets killed, or nc stops..
Logs say:
Feb 10 09:41:30 oac vdr: [31783] switching to channel 409 Feb 10 09:41:30 oac vdr: [12720] transfer thread ended (pid=31783, tid=12720) Feb 10 09:41:30 oac vdr: [31783] buffer stats: 33652 (1%) used Feb 10 09:41:30 oac vdr: [31783] IPTV: cSidScanner::SetStatus(): 0 Feb 10 09:41:30 oac vdr: [31783] IPTV: cSidScanner::SetChannel(): IPTV| S1P1|EXT|streamsvideo.sh|951 Feb 10 09:41:30 oac vdr: [31783] IPTV: cPidScanner::SetChannel(): IPTV| S1P1|EXT|streamsvideo.sh|951 Feb 10 09:41:30 oac vdr: [31783] IPTV: cSidScanner::SetStatus(): 0 Feb 10 09:41:30 oac vdr: [31783] IPTV: cSidScanner::SetStatus(): 1 Feb 10 09:41:30 oac vdr: [12724] transfer thread started (pid=31783, tid=12724) Feb 10 09:41:30 oac vdr: [12725] receiver on device 10 thread started (pid=31783, tid=12725) Feb 10 09:41:30 oac vdr: [12725] IPTV: cIptvUdpSocket::OpenSocket() Feb 10 09:41:30 oac vdr: [12725] IPTV: cIptvSocket::OpenSocket() Feb 10 09:41:30 oac vdr: [12725] IPTV: cSidScanner::SetStatus(): 1 Feb 10 09:41:30 oac vdr: [31783] [xine..put] Detected HD OSD, size > 752x1072, using setup values 752x647 Feb 10 09:41:30 oac vdr: [12727] IPTV streamer thread started (pid=31783, tid=12727) Feb 10 09:41:30 oac vdr: [12728] EnigmaNG effects thread started (pid=31783, tid=12728) Feb 10 09:41:30 oac vdr: [31783] EnigmaNG: cPluginSkinEnigma::LoadChannelLogo: LOGO "Hauppuage-test.xpm" NOT FOUND in /usr/share/vdr/skinenigmang/[hq]logos Feb 10 09:41:30 oac vdr: [12722] TS buffer on device 1 thread ended (pid=31783, tid=12722) Feb 10 09:41:30 oac vdr: [12721] buffer stats: 32336 (1%) used Feb 10 09:41:30 oac vdr: [12721] receiver on device 1 thread ended (pid=31783, tid=12721) Feb 10 09:41:32 oac vdr: [12725] IPTV: cPidScanner::Process: Found lower Apid: 0x1100 instead of 0xFFFF Feb 10 09:41:32 oac vdr: [31810] IPTV: cSidScanner::Process(): Pid=0 Tid=00 Feb 10 09:41:32 oac vdr: [31810] IPTV: cSidScanner::SetChannel() Feb 10 09:41:32 oac vdr: [31810] IPTV: cSidScanner::SetStatus(): 0 Feb 10 09:41:32 oac vdr: [12725] IPTV: cPidScanner::Process: Found lower Vpid: 0x1011 instead of 0xFFFF Feb 10 09:41:33 oac vdr: [12725] ERROR: Skipped 36 bytes to sync on TS packet Feb 10 09:41:33 oac vdr: [12725] IPTV: cSidScanner::SetStatus(): 0 Feb 10 09:41:33 oac vdr: [12727] IPTV streamer thread ended (pid=31783, tid=12727) Feb 10 09:41:33 oac vdr: [12725] IPTV: cIptvSocket::CloseSocket() Feb 10 09:41:33 oac vdr: [12725] receiver on device 10 thread ended (pid=31783, tid=12725) Feb 10 09:41:35 oac vdr: [12728] EnigmaNG effects thread ended (pid=31783, tid=12728)