0
votes

i am trying to use ffmpeg as a live transcoder to transcode tv channels from udp input to rtmp output to a wowza server.

i have 2 kinds of input channels in 1st kind the input audio is mp2 and in the second kind the input audio is acc_latm.

my problem is when i transcode the mp2 channels everything is fine but when i try to transcode the aac channel the audio is muted after few hours. but the video is fine.

the output codecs are : libx264 for video and faac or fdk-aac for audio output i tried both aac encoders but it did not change.

i think it is the ffmpeg aac decoder's problem. but i cannot fix this.

i need a way to detect the problem online and restart the ffmpeg. or change the ffmpeg decoder codec.

please help. thanks.

1
Showing your actual ffmpeg commands and the complete console outputs is a requirement when asking questions about ffmpeg usage.llogan

1 Answers

0
votes

Yeah, ffmpeg is not guaranteed stable. Zoneminder used to detect crashes and restart processes when that happens. You may look at their code although IIRC they were only looking for video.

I think it would be simpler if you can enable some level of verbosity or debugging (-v loglevel) and see what messages indicated a crash (use grep to detect and some script to restart). That would be most efficient. Another thing comes to mind is use ffmpeg/avconv to extract your resulting audio track and monitor it for some pattern in the file. Or play the resulting file and use an alsa device piping to a script. But it is under question if you would be able to reliably detect broken from legitimate silence. Much less efficient as well. Let me know if you can't figure the alsa device setup if you go that route, I don't have it handy right now.