I'm trying to stream .wav audio files via RTP multicast. I'm using the following command:
ffmpeg -re -i Melody_file.wav -f rtp rtp://224.0.1.211:5001
It successfully initiates the stream. However, the audio comes out very choppy. Any ideas how I can make the audio stream clean? I do not need any video at all. Below is a screenshot of my output:
Here's some examples expanding upon the useful comments between #Ralf and #Ahmed about setting asetnsamples and aresample, and also those mentioned in the Snom wiki. Basically one can get smoother multicast transmission/playback using these approaches for G711/mulaw audio:
ffmpeg -re -i Melody_file.wav -filter_complex 'aresample=8000,asetnsamples=n=160' -acodec pcm_mulaw -ac 1 -f rtp rtp://224.0.1.211:5001
Or using higher quality G722 audio codec:
ffmpeg -re -i Melody_file.wav -filter_complex 'aresample=16000,asetnsamples=n=160' -acodec g722 -ac 1 -f rtp rtp://224.0.1.211:5001
Related
I have a mpeg file with two video streams stream
#0:0[0x27] yuv420p 352X288
and
#0:1[0x29] yuv420p 640X480
I am trying to read the file and send it out rtmp
ffmpeg -stream_loop -1 -i myvideofile.mpg -f mpegts udp://localhost:123456
To verify the stream is streaming I use ffplay
ffplay udp://localhost:123456
I get the video, but it is only one of the two streams I am expecting. the 640x480
Is there something that I need to do to make both streams get sent?
To remap all streams you have to pass -map 0.
ffmpeg -stream_loop -1 -i myvideofile.mpg -map 0 -f mpegts udp://localhost:123456
i've been trying to create a transport stream using FFMPEG, when i tried it in VLC it was working immediately, however when i stream from FFMPEG to VLC i can't get it to work, here's my string:
ffmpeg -re -i http://ip-of-shoutcast-stream:port?listen -c:a aac -b:a 128k -ar 44100 -ac 2 -vn -f mpegts udp://ip-of-destination-pc:1234?pkt_size=1316
In VLC i use the same network source i used when VLC was streaming in the main PC:
udp://ip-of-main-pc:1234
But it doesn't play or show any errors, the orange bar only goes back and forth endlessly.
What am i doing wrong in the FFMPEG and/or VLC side? It has to be FFMPEG since it's getting moved to a server.
I am a bit new to FFMPEG and will appreciate any help I can get!
Basically, I am trying to transcode a 'webm' UDP stream to Opus audio stream, and then finally output that to a specific UDP port on my network.
This is the command I am using:
ffmpeg -re -i udp://127.0.0.1:2222 -vn -map 0:a -c:a libopus -f ogg udp://127.0.0.1:2224
However, when I check on port 2224, I do not receive any packets.
FFMPEG is definitely receiving the input packets because if I run the following command, the file plays out perfectly:
ffmpeg -re -i udp://127.0.0.1:2222 -vn -map 0:a -c:a libopus -f test.opus
Does anyone have any suggestions on what mistake I am making?
I have a wifi camera that uses RTSP/ONVIF protocol and after reading FFMPEG docs and some threads at Google I am trying to broadcast the stream to Youtube. So I started a broadcast at youtube and in my computer in ffmpeg I executed this command:
ffmpeg -f lavfi -i anullsrc -rtsp_transport udp -i rtsp://200.193.21.176:6002/onvif1 -tune zerolatency -vcodec libx264 -t 12:00:00 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv rtmp://x.rtmp.youtube.com/live2/private_key
The command above looks like it's correct cause it ouputs constantly something like this:
The problem is that at YOUTUBE it still says I am offline. Why?
Try replace first part to: ffmpeg -re -i somefile.mp4, so you will to know, if here any problems with your camera or not.
ffmpeg and VLC very similar and even uses same code for codecs. But RTSP it handles differently. But try just ffmpeg -i rtsp://200.193.21.176:6002/onvif1 and nothing more as source.
I'm trying to stream a .ts file containing H.264 and AAC as an RTP stream to an Android device.
I tried:
.\ffmpeg -fflags +genpts -re -i 1.ts -vcodec copy -an -f rtp rtp://127.0.0.1:10
000 -vn -acodec copy -f rtp rtp://127.0.0.1:20000 -newaudio
FFMPEG displays what should be in your SDP file and I copied this into an SDP file and tried playing from VLC and FFPLAY. VLC plays audio but just gives errors re: bad NAL unit types for video. FFPLAY doesn't play anything.
My best guess if that the FFMPEG H.264 RTP implementation is broken or at least it doesn't work in video passthru mode (i.e. using the -vcodec copy).
I need a fix for FFMPEG or an alternate simple open-source solution. I don't want to install FFMPEG in my Android client.
thanks.
Have you tried vlc?I once used vlc for streaming. You can have a look at here.