swesterfeld / audiowmark

Audio Watermarking
GNU General Public License v3.0
380 stars 75 forks source link

insert audiowatermark to UDP multicast Live Stream #9

Open rtpmedia opened 2 years ago

rtpmedia commented 2 years ago

Stefan. I am interested in your audio watermark solution. Can it be used in live mpeg ts udp multicast broadcasting without video encoding ? If yes, please send a description of how to do it

swesterfeld commented 2 years ago

If I understand your use case correctly, there is no direct support in audiowmark to do it (so there is no code to do anything for live mpeg ts / udp / multicast / broadcasting). However, what you could do is that you spawn an audiowmark add - - ... subprocess that does the watermarking on a stream of raw samples. You should then provide the input as raw samples and encode and send the output of the process using whatever method you want.

See

Here is an example of watermarking a stream using mpg123 1.25.13 and play the result using sox:

mpg123 -s song.mp3 | audiowmark add - - f0 --format raw --raw-rate 44100 | play -t raw -e signed -b 16 -r 44100 -c 2 -
rtpmedia commented 2 years ago

Thanks for the reply. I read this

https://github.com/swesterfeld/audiowmark#output-as-stream https://github.com/swesterfeld/audiowmark#input-from-stream https://github.com/swesterfeld/audiowmark#raw-streams Clarify in your example what is

mpg123 -s song.mp3 ?

The rest is clear.

In this case, it works.

ffmpeg -threads auto -thread_type 1 -i "udp://224.0.191.78:1234?fifo_size=50000000&overrun_nonfatal=1" -f s16le -acodec pcm_s16le -ar 48000 -ac 2 -vn -sn pipe:1 | ./audiowmark add - out.wav 0123456789abcdef0011223344556677 --input-format raw --raw-rate 48000

I have udp multicast at the input and udp multicast should be at the output