Opened 22 months ago

Last modified 19 months ago

#9102 new defect

make HLS from multicast with ac3 audio track which have 0 channels

Reported by: krs_vital Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: ac3
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I want to make HLS with stream determined like this:

[mpegts @ 0x2635780] Could not find codec parameters for stream 3 (Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (25000000) and 'probesize' (25000000) options
Input #0, mpegts, from 'udp://239.192.39.3:1234':

Duration: N/A, start: 42075.039333, bitrate: N/A
Program 17104

Metadata:

service_name : VIP Premiere
service_provider: HTB+

Stream #0:1[0x130]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:2[0x194](rus): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x1a8](rus): Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp
Stream #0:4[0x1f8](rus): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

but ffmpeg stops and do nothing.

sometimes in this stream on audio track [Stream #0:3] appears bitrate when TV provider make it, but sometimes this audio track is empty.This usually happens when content with 5.1 sound is turned on and then this track is not empty.

How to make ffmpeg automatically detect the audio track on the fly and start working with it, since during decoding it can be empty or not?

Ffmpeg starts like this:

/usr/local/bin/ffmpeg -analyzeduration 25000000 -probesize 25000000 -dts_delta_threshold 3600 -err_detect ignore_err -correct_ts_overflow 0 -copytb 1 -overrun_nonfatal 1 -i udp://239.192.39.3:1234 -y -sn -dn -c:v copy -c:a aac -vsync 1 -hls_time 10 -map 0 -ignore_unknown -strftime 1 -strftime_mkdir 1 -max_interleave_delta 360000000000 -hls_flags omit_endlist -hls_segment_filename /store/records/Premium/%Y/%m/%d/%H/%s.ts /hls/tmp/Premium.m3u8

Change History (6)

comment:1 by Steven Liu, 22 months ago

Could you upload the recording file mpegts,

/usr/local/bin/ffmpeg -analyzeduration 25000000 -probesize 25000000 -dts_delta_threshold 3600 -err_detect ignore_err -correct_ts_overflow 0 -copytb 1 -overrun_nonfatal 1 -i udp://239.192.39.3:1234 -y -sn -dn -c:v copy -c:a aac -vsync 1 -map 0 -max_interleave_delta 360000000000 -t 60 output.ts

comment:2 by krs_vital, 22 months ago

i cant record with ffmpeg becouse it cut stream with 0 channels:

ffmpeg -i udp://239.192.39.3:1234 -c copy /var/db/stream.ts

[mpegts @ 0x3027e00] Could not find codec parameters for stream 3 (Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpegts, from 'udp://239.192.39.3:1234':

Duration: N/A, start: 75125.665644, bitrate: N/A
Program 17104

Metadata:

service_name : VIP Premiere
service_provider: HTB+

Stream #0:1[0x130]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:2[0x194](rus): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x1a8](rus): Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp
Stream #0:4[0x1f8](rus): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

No Program

Stream #0:0[0x12]: Data: epg

Output #0, mpegts, to '/var/db/stream.ts':

Metadata:

encoder : Lavf58.65.101
Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 tbr, 90k tbn, 90k tbc
Stream #0:1(rus): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s

Stream mapping:

Stream #0:1 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)

Press [q] to stop, ? for help

but i managed to do this with multicat from videolan:

/usr/local/bin/multicat -Uuf -t 10 @239.192.39.3 /var/db/stream.ts

https://mycloud.g-service.ru:4430/s/A0OG7IFql1Tc6Zz

Last edited 22 months ago by krs_vital (previous) (diff)

in reply to:  2 comment:3 by Steven Liu, 22 months ago

Replying to krs_vital:

i cant record with ffmpeg becouse it cut stream with 0 channels:

Can i think this is not hls problem, it should happen in mpegts or udp?

ffmpeg -i udp://239.192.39.3:1234 -c copy /var/db/stream.ts

[mpegts @ 0x3027e00] Could not find codec parameters for stream 3 (Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpegts, from 'udp://239.192.39.3:1234':

Duration: N/A, start: 75125.665644, bitrate: N/A
Program 17104

Metadata:

service_name : VIP Premiere
service_provider: HTB+

Stream #0:1[0x130]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:2[0x194](rus): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x1a8](rus): Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp
Stream #0:4[0x1f8](rus): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

No Program

Stream #0:0[0x12]: Data: epg

Output #0, mpegts, to '/var/db/stream.ts':

Metadata:

encoder : Lavf58.65.101
Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 tbr, 90k tbn, 90k tbc
Stream #0:1(rus): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s

Stream mapping:

Stream #0:1 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)

Press [q] to stop, ? for help

but i managed to do this with multicat from videolan:

/usr/local/bin/multicat -Uuf -t 10 @239.192.39.3 /var/db/stream.ts

https://mycloud.g-service.ru:4430/s/A0OG7IFql1Tc6Zz

comment:4 by krs_vital, 22 months ago

it happens in both cases, there is no audio ac3 track on the output:

ffmpeg -re -i ./stream.ts -c copy -f mpegts udp://239.192.33.33:1234

[mpegts @ 0x42bca40] start time for stream 0 is not set in estimate_timings_from_pts
[mpegts @ 0x42bca40] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 0x42bca40] start time for stream 4 is not set in estimate_timings_from_pts
[mpegts @ 0x42bca40] PES packet size mismatch
[mpegts @ 0x42bca40] Packet corrupt (stream = 2, dts = 6774606868).
[mpegts @ 0x42bca40] stream 3 : no TS found at start of file, duration not set
[mpegts @ 0x42bca40] Could not find codec parameters for stream 3 (Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from './stream.ts':

Duration: 00:00:20.13, start: 75254.113644, bitrate: 6130 kb/s
Program 17104

Metadata:

service_name : VIP Premiere
service_provider: HTB+

Stream #0:1[0x130]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:2[0x194](rus): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Stream #0:3[0x1a8](rus): Audio: ac3 (AC-3 / 0x332D4341), 0 channels, fltp
Stream #0:4[0x1f8](rus): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

No Program

Stream #0:0[0x12]: Data: epg

Output #0, mpegts, to 'udp://239.192.33.33:1234':

Metadata:

encoder : Lavf58.43.100
Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 tbr, 90k tbn, 90k tbc
Stream #0:1(rus): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s

Stream mapping:

Stream #0:1 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)

comment:5 by krs_vital, 22 months ago

i found the same problem with mp3 audio track (https://mycloud.g-service.ru:4430/s/Sb1j5fjWNCpMYUE):

ffprobe -i /var/db/stream1.ts

[mpegts @ 0x349ddc0] Could not find codec parameters for stream 3 (Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels): unspecified frame size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpegts, from '/var/db/stream1.ts':

Duration: 00:00:10.41, start: 89870.739067, bitrate: 8233 kb/s
Program 17105

Metadata:

service_name : Viasat Nature/History HD
service_provider: HTB+

Stream #0:1[0x131]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:2[0x195](rus): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 160 kb/s
Stream #0:3[0x1a9](eng): Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels
Stream #0:4[0x7c1](rus): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)

No Program

Stream #0:0[0x12]: Data: epg

Unsupported codec with id 98306 for input stream 0

comment:6 by krs_vital, 19 months ago

Last edited 19 months ago by krs_vital (previous) (diff)
Note: See TracTickets for help on using tickets.