How can I concatenate ATSC streams from DVB card?

南楼画角 提交于 2019-12-11 08:09:53

问题


I'm trying to make a simple "TV viewer" using a Linux DVB video capture card. Currently I watch TV using the following process (I'm on a Raspberry Pi):

  1. Tune to a channel using azap -r TV_CHANNEL_HERE. This will supply bytes to device /dev/dvb/adapter0/dvr0.
  2. Open OMXPlayer omxplayer /dev/dvb/adapter0/dvr0
  3. Watch TV!

The problem comes when I try to change channels. Even if I set the player to cache incoming bytes (tried with MPlayer also), the player can't withstand a channel change (by restarting azap with a new channel.

I'm thinking this is because of changes in the MPEG TS stream metadata.

Looking for a C library that would let me do the following:

  1. Pull cache_size * mpeg_ts_packet_size from DVR device.
  2. Evaluate each packet and rewrite metadata (PID, etc) as needed.
  3. Populate FIFO with resulting packet.
  4. Set {OMXPlayer,MPlayer} to read from FIFO.

The other thing I was thinking would be to use a program that converts MPEG TS into MPEG PS and concatenate the bytes that way.

Thoughts?


回答1:


Indeed, when you want to tune on an other channel, some metadata can potentially change and invalid previously cached data. Unfortunately I'm not familiar with the tools you are using but your point 2. makes me raise an eyebrow: you will waste your time trying to rewrite Transport Stream data.

I would rather suggest to stop and restart process on zapping since it seems to work fine at start.

P.S.: Here are some tools that can help. Also, I'm not sure at which level your problem is but VLC can be installed on Raspberry PI and it handles TS gracefully.



来源:https://stackoverflow.com/questions/25107625/how-can-i-concatenate-atsc-streams-from-dvb-card

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!