Avalpa Community

The place where we can talk freely about Avalpa product and services
It is currently Fri May 27, 2022 11:09 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: AC3 Audio does not play.
PostPosted: Mon Jun 16, 2014 7:18 am 
Offline

Joined: Fri Dec 20, 2013 8:35 am
Posts: 6
I have a strange issue where AC-3 audio does not play in the final TX. The audio track appears, it seems to be "there", but there is silence. My TV plays stuttering audio; (silence for one second, sound for half a second, etc). I'm not exactly sure what I'm doing wrong. The audio works fine at the ffmpeg stage.

Here is esaudioinfo:
Code:
ac3 sampling rate is 48000
ac3 frame size is 768 byte
audio frame size from stream measured: 768 bytes, 6144 bits


Here is my script:
Code:
#!/bin/bash
PS='PSIP'

ffmpeg -loglevel quiet -i test.mkv -vcodec mpeg2video -pix_fmt yuv420p -flags +ilme+ildct -alternate_scan 1 \
-top 0 -me_method epzs -threads 4 -r 30 -g 45 -bf 2 -trellis 2 -cmp 2 -subcmp 2 -s 1920x1088 -b 16900k \
-minrate 16000k -maxrate 17200k -f mpeg2video -y /tmp/video.es -acodec ac3 -ar 48000 -ab 192k -f ac3 \
-y /tmp/audio.es &

#Convert elementary stream to a PES.
/usr/local/bin/esaudio2pes /tmp/audio.es 1152 48000 768 0 > /tmp/audio.pes &
/usr/local/bin/esvideompeg2pes /tmp/video.es > /tmp/video.pes &

#Convert PES to TS.
/usr/local/bin/pesaudio2ts 65 1152 48000 768 0 /tmp/audio.pes > /tmp/audio.ts &
/usr/local/bin/pesvideo2ts 60 30 256 17000000 0 /tmp/video.pes > /tmp/video.ts &

#Mux transport streams.
/usr/local/bin/tscbrmuxer b:18100000 /tmp/video.ts b:20000 /tmp/audio.ts b:4000 $PS/pat.ts b:4000 $PS/pmt.ts b:4000 $PS/8187.ts o:19100000 $PS/null.ts > atsc.ts


Any assistance here would be immensely appreciated. Everything works fine except for this audio issue. :)


Top
 Profile  
 
PostPosted: Wed Jun 18, 2014 12:37 pm 
Offline

Joined: Sun Sep 22, 2013 10:29 am
Posts: 39
thanx for the proper report. can you tell us the version of ffmpeg you are using?

sadly we can't test a similar setup in a short term.

the first issue is HOW to detect with precision what's the real problem. the stuttering can arise from a number of different situations and could be an interworking issue too with the "decoder" (where are you getting it from? a tv set?)

i suppose you do not have any "stream analyzer" down the chain to check the output, they are a bit expensive.

you could try to use these tools to decode and check the output anyway. to see if the AC3 stream is validated.

http://www.ac3filter.net/wiki/AC3Filter_tools

if it's valid, of course stuttering usually means that the PTS sync betweeen audio and video is broken. and audio frames are too late or too early (or too "jumpy" but an audio stream is quite CBR AFAIK).

you could check this on some tv sets where there'a serial port and a debug menu with info from the decoders where they sometime tell you about these broken conditions (then how to recover is another issue..)

for example "Samygo service menu" query could be a good starting point to follow this lead. and it's anyway a good educational lesson!

bests

andrea


Top
 Profile  
 
 Post subject: Hm?
PostPosted: Sat Jun 21, 2014 7:04 am 
Offline

Joined: Fri Dec 20, 2013 8:35 am
Posts: 6
FFMPEG version is N-64012-g61df081 (Source from the git package in the AUR) Audio plays fine on TVs, STBs, it incurs the problems when it is sent through the various Opencaster tools.

I sadly do not have a receiver capable of debugging the feed. I have the "lite" version of TSReader, but that is far from verbose enough to assist me here. The manual for Opencaster isn't all too clear as to how you get the numbers for esaudio2pes, and pesaudio2ts. Is there a set formula or equation to get this information?

The audio is in the AC-3 format, at 192 kilobits/second, with an AF of 48khz. As the esinfo stated....
Code:
ac3 sampling rate is 48000
ac3 frame size is 768 byte
audio frame size from stream measured: 768 bytes, 6144 bits

What exactly, outside of the PID of course, do I need for esaudio2pes, and pesaudio2ts?

As previously stated, the manual isn't that clear on how to figure out the frame size, rate, etc. How would those two commands look? The rest of my chain is fine...it's just the audio that refuses to work.

I appreciate your assistance so far.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group