Author Topic: no audio with dvb-t2 recordings  (Read 1682 times)

bernd_b

  • Full Member
  • ***
  • Posts: 103
no audio with dvb-t2 recordings
« on: September 13, 2019, 09:54:29 PM »
Here is an example of a record I've done with tvheadend and my dvb-t2 device:
https://www.dropbox.com/s/foryfsjme0o1jjo/Brisant.ts?dl=0

Loading this file into avidemux, avidemux tells me that the file has no audio tracks. The file is played fine (including audio) with mpv. Ffmpeg processes the file as well, e.g:

Code: [Select]
ffmpeg -i Brisant.ts -codec copy -map 0:0 -map 0:1 -map 0:2 Brisant.mkv

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: no audio with dvb-t2 recordings
« Reply #1 on: September 14, 2019, 06:48:31 AM »
Confirming the issue, thank you for the sample.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: no audio with dvb-t2 recordings
« Reply #2 on: September 15, 2019, 12:16:35 PM »
Should be fixed by [coreAudioParser,demuxers/MpegTS] Support LATM frames not aligned at PES packet boundaries, demux one LATM frame at a time to reduce the odds to run out of free buffers, please try a future nightly and don't forget to delete the old *.idx2 file before loading the stream in Avidemux.

Is tvheadend remuxing and repackaging the incoming MPEG-TS stream on-the-fly? Does it matter whether you write the output of /dev/dvb/adapterN/dvr0 to a file (N = 0 for the first DVB card, replace it with the figure matching your setup) or use tvheadend to record the stream?

I had a few DVB-T2 samples with LATM AAC audio tracks here but never encountered something like yours. Usually LATM frames are aligned on PES packet boundaries and the PES packets are rather small (often 1 frame in a single PES packet). In your sample they are not aligned and the PES packets are huge.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: no audio with dvb-t2 recordings
« Reply #3 on: September 15, 2019, 12:56:03 PM »
please try a future nightly

...or just build Avidemux from git master if you are on Linux anyway.
« Last Edit: September 15, 2019, 01:01:18 PM by eumagga0x2a »

bernd_b

  • Full Member
  • ***
  • Posts: 103
Re: no audio with dvb-t2 recordings
« Reply #4 on: September 15, 2019, 04:00:40 PM »
... write the output of /dev/dvb/adapterN/dvr0 to a file (N = 0 for the first DVB card, replace it with the figure matching your setup) ...

Ups, I think I am not aware of how to do the trick.

Is tvheadend remuxing and repackaging the incoming MPEG-TS stream on-the-fly?
I strongly believe so, the profile I used is called "pass", but since the other profiles allow recording into a mkv-container or even reencoding on the fly, I think "pass" means remuxing with copying the streams.

Doing a test record with vdr and tvheadend of the same program, avidemux again says no audio with the tvheadend file but recognizes one audio stream with the vdr-record. But if I process this file (using copy for audio and video) into a mkv-container, the resulting file plays with no audio in mpv, so the audio seems to get lost even with a vdr-record.

I will try a nightly in the next days. I am not able to build the git version
Code: [Select]
Make Error at CMakeLists.txt:213 (ADD_SUBDIRECTORY):
  The source directory

    /mnt/Data_bb/sda8/makepkg/avidemux/avidemux2/avidemux/qt4/i18n

  does not contain a CMakeLists.txt file.



**************************
***  Optional Library  ***
***      Summary       ***
**************************
*** Video Encoder      ***
    NVENC          Yes
*** Miscellaneous      ***
    gettext        Yes
    SDL            No
    XVideo         Yes
    OpenGL         Yes
**************************
***   Release Build    ***
**************************

-- No packaging... (package=)

-- Configuring incomplete, errors occurred!
See also "/mnt/Data_bb/sda8/makepkg/avidemux/avidemux2/buildQt5/CMakeFiles/CMakeOutput.log".
See also "/mnt/Data_bb/sda8/makepkg/avidemux/avidemux2/buildQt5/CMakeFiles/CMakeError.log".
** Failed at cmakeZ**

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: no audio with dvb-t2 recordings
« Reply #5 on: September 15, 2019, 04:08:21 PM »
https://avidemux.org/smif/index.php/topic,18826.0.html

Regarding the stream remuxed to mkv, it is ffmpeg not extracting AAC stream from LATM. I was about to investigate whether we can support this in the mkv demuxer.

bernd_b

  • Full Member
  • ***
  • Posts: 103
Re: no audio with dvb-t2 recordings
« Reply #6 on: September 15, 2019, 04:31:59 PM »
Thanks for the link, the compilation went through now!

And I could process all my test files (vdr-Recording and tvheadend-recordings), all two audio tracks were cut+copied into a new mkv-container!!!

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: no audio with dvb-t2 recordings
« Reply #7 on: September 15, 2019, 07:16:26 PM »
... write the output of /dev/dvb/adapterN/dvr0 to a file (N = 0 for the first DVB card, replace it with the figure matching your setup) ...

Ups, I think I am not aware of how to do the trick.

With the old DVB-T, it implied using the tzap utility to tune to the desired program (required a proper ~/.tzap/channels.conf file) and running something like

Code: [Select]
dd if=/dev/dvb/adapter0/dvr0 of=/path/to/output.ts
optionally with the input-output unit increased from the default 512 bytes to something like 512 kiB by adding bs=512K to the command in order to reduce the number of writes (the whole was never particularly stable because the latency of writing to a hard disk resulted sometimes in internal buffer overflows and recording stopping). I'm not up to date myself regarding DVB-T2, but

Code: [Select]
mpv --stream-dump=/path/to/output.ts dvb://"Program name"
should work for any kind of DVB.

Quote
Doing a test record with vdr and tvheadend of the same program, avidemux again says no audio with the tvheadend file but recognizes one audio stream with the vdr-record.

Thanks, now we know who is doing strange things (it is tvheadend), so the impact of the former inability of Avidemux to handle badly aligned LATM streams in MPEG-TS should be very, very limited. Nevertheless, thank you for raising the topic.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: no audio with dvb-t2 recordings
« Reply #8 on: September 19, 2019, 01:19:15 PM »
Doing a test record with vdr and tvheadend of the same program, avidemux again says no audio with the tvheadend file but recognizes one audio stream with the vdr-record. But if I process this file (using copy for audio and video) into a mkv-container, the resulting file plays with no audio in mpv, so the audio seems to get lost even with a vdr-record.

I might have misinterpreted the part about vdr-record processed to mkv. Could you please provide a sample ts file produced by vdr-record from DVB-T2 with AAC LATM audio tracks?

bernd_b

  • Full Member
  • ***
  • Posts: 103
Re: no audio with dvb-t2 recordings
« Reply #9 on: September 19, 2019, 05:07:12 PM »
Here is the link to the test record I've done:

https://www.dropbox.com/s/2n3358cydvwcsix/Isar_recorded_with_vdr.ts?dl=0

May it help.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3406
Re: no audio with dvb-t2 recordings
« Reply #10 on: September 20, 2019, 11:21:31 AM »
Thank you very much for the sample. There is no difference to the stream recorded with tvheadend. Same huge PES packets and LATM frames not aligned at PES packet boundaries. I'll try to get an independent DVB-T2 sample to be absolutely sure.

If the DVB-T2 broadcast mode has really changed, many more Avidemux users are affected (need to rely on nightly builds for time being).