signalwareltd / AndroidDvbDriver

Android driver framework for USB TV tuners
GNU General Public License v2.0
186 stars 65 forks source link

Playback of TS from DVB Driver #28

Open a4tech opened 4 years ago

a4tech commented 4 years ago

Hello,

Is there any suggestion which player shall We use or how to use for TS playback ?

The problem is even I record TS to a file and ply by ExoPlayer, ijkPlayer, MediaPlayer frameworks the stream play only amount of data which I have setDataSource(xx). Even it record more in mean time. All the players stop working.

My question is about a tip how to write/record to a file and play it in same time.

Thanks

thibautperrin commented 4 years ago

Hello, A working solution is to read the stream from the DVB driver and write its data in two different streams :

  1. A FileOutputStream to save the TS data.
  2. The other stream is to be used by VLC or any other player...

Tested on an Android AOSP box, it works well.

Best regards, Thibaut

a4tech commented 4 years ago

Hello thibautperrin,

  1. That I have done and I open TS file I saved ( and it keep saving... al the time as stream is going from DVB-T all the time) by VLC Player and it plays only time amount since 0 till I open file, means it reach EOF after a while - even file size and stream is increasing all the time - even up to 500MB.
  2. Other Stream is for EPG ?

Could You give a hint for that ? I am testing on AOSP box as well. Buffering recorded file like >1 GB can cause issues as well

Regards

thibautperrin commented 4 years ago

Hello, I understand, but in that way, it is a Linux's file access issue.

No, the driver stream must contains at least PID 0, the PID of the PMT and the PIDs of the media (audio, video... provided in the PMT). There is no need for the EPGs.

Best regards, Thibaut

a4tech commented 4 years ago

Hello,

Could You try to make some psudo-code for understanding Your idea about 2 x FileOutputStream ?

I still do not understand how can I not save TS and play it - buffer for playback gets so big and more over as I mentioned playback by vlc stop after few seconds when I write to TS file and read by VLC.

Thank You for more description.

a4tech commented 4 years ago

Finally got PLAYBACK from WRITING file.

So I play the TS Recorded by pressing TS RECORD button.

My question and last question :) is:

The file is getting huge after I watch 1hour it is like >2GB !

Any idea how to solve that problem ?