FFMpeg not printing SDP information to console - ffmpeg

I was trying to create an FFMpeg stream and read it from VLC player, but I am getting an error saying SDP is required. However FFMpeg is not printing the SDP information to console as it is supposed to. How can I get the SDP file for the stream?
Here is the command I am using to stream
ffmpeg -f dshow -r 10000/1001 -i video="screen-capture-recorder" -vcodec libx264 -tune zerolatency -b 900k -f mpegts rtp://127.0.0.1:1234

I found out what I had done wrong. I was previously using this command:
ffmpeg -f dshow -r 10000/1001 -i video="screen-capture-recorder" -vcodec libx264 -tune zerolatency -b 900k -f mpegts rtp://127.0.0.1:1234
Which I changed to this:
ffmpeg -f dshow -r 10000/1001 -i video="screen-capture-recorder" -vcodec libx264 -tune zerolatency -b 900k -f rtp rtp://127.0.0.1:1234
I just changed "mpegts" to "rtp" since that is the protocol I was using.

Related

Streaming to localhost using FFmpeg doesn't work

I'm trying to stream my screen using FFmpeg, but I can't access it using VLC player - it keeps loading the stream and doesn't show anything.
The command I use:
ffmpeg -f gdigrab -s 1920x1080 -i desktop -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f rtp rtp://localhost:1234
The network URL I put in VLC:
udp://localhost:1234
What am I doing wrong?

ffmpeg only works 2 instances

I have 3 usb web cameras. Im using Windows 7.
I have 3 usb web cameras
And I need to create 3 video streams:
ffmpeg -f dshow -i video="Full HD webcam" -vcodec libx264 -tune zerolatency -threads 0 -b 900k -f mpegts udp://localhost:1234
ffmpeg -f dshow -i video=”#device_pnp_\?\usb#vid_1908&pid_2311&mi_00#8&134fde2a&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global” -vcodec libx264 -tune zerolatency -threads 0 -b 900k -f mpegts udp://localhost:1233
ffmpeg -f dshow -i video="#device_pnp_\?\usb#vid_1908&pid_2311&mi_00#8&962d85&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global" -vcodec libx264 -tune zerolatency -threads 0 -b 900k -f mpegts udp://localhost:1232
But only works 2 any instances of video streams. When I try to create third video stream I get error:
I get error
Can anybody help me, please?
i tried to create 3 video streams, but could only create 2 instances of ffmpeg process.

ffmpeg stream an audio file to Telegram rtmp server

I tried to stream an mp3 file to a Telegram RTMP live using the following command:
ffmpeg -re -i 1.mp3 -c copy -f mp3 rtmps://dc4-1.rtmp.t.me/s/145158:AtyF3rrME2nHEkqGA
But I couldn't hear any sound in the stream.
You should specify the codecs explicitly.
The following is the simplest working command:
ffmpeg -i your_input -c:v libx264 -c:a aac -f flv rtmps://dcx-y.rtmp.t.me/s/YOUR_KEY
Here is a more advanced example from #tgbeta:
ffmpeg -stream_loop -1 -re -i your_input -c:v libx264 -preset veryfast -b:v 3500k -maxrate 3500k -bufsize 7000k -pix_fmt yuv420p -g 50 -c:a aac -b:a 160k -ac 2 -ar 44100 -f flv rtmps://dcx-y.rtmp.t.me/s/YOUR_KEY
Change -f mp3 by -f flv.
Example:
ffmpeg -re -i 1.mp3 -c:a copy -f flv rtmps://dc4-1.rtmp.t.me/s/145158:AtyF3rrME2nHEkqGA

How to properly format FFmpeg's -vf options for both text and snapshots?

I've got this working:
ffmpeg -input_format yuyv422 -f v4l2 -s 800x448 -r 30 -i /dev/video0 -vf "[in]drawtext=fontfile=/usr/share/fonts/truetype/freefont/Roboto-Regular.ttf:text='%{localtime\:%d %b %Y}':x=8:y=8:fontcolor=white:box=1:boxcolor=black#0.75,drawtext=fontfile=/usr/share/fonts/truetype/freefont/Roboto-Regular.ttf:text='%{localtime\:%T}':x=8:y=24:fontcolor=white:box=1:boxcolor=black#0.75" -c:v h264_omx -r 30 -b:v 2M -an -f rtsp rtsp://localhost:8554/mystream
It outputs a steady video-stream, with a double-lined text overlay, from my USB-connected webcam to rtsp-simple-server on my RPi 3A+.
I've also got this working:
ffmpeg -input_format yuyv422 -f v4l2 -s 800x448 -r 30 -i /dev/video0 -c:v h264_omx -r 30 -b:v 2M -vf fps=1/20 -update 1 /dev/shm/snapshot.jpg -an -f rtsp rtsp://localhost:8554/mystream
But I can't figure out how to make FFmpeg do both at the same time - a video stream with double-lined text overlay, while saving a snapshot now and then to /dev/shm.
What would the correct syntax for this look like?
Combined command:
ffmpeg -f v4l2 -input_format yuyv422 -video_size 800x448 -framerate 30 -i /dev/video0 -filter_complex "[0]vflip,drawtext=fontfile=/usr/share/fonts/truetype/freefont/Roboto-Regular.ttf:text='%{localtime\:%d %b %Y}':x=8:y=8:fontcolor=white:box=1:boxcolor=black#0.75,drawtext=fontfile=/usr/share/fonts/truetype/freefont/Roboto-Regular.ttf:text='%{localtime\:%T}':x=8:y=24:fontcolor=white:box=1:boxcolor=black#0.75[vid];[0]fps=1/20,vflip[img]" -map "[vid]" -c:v h264_omx -b:v 2M -f rtsp rtsp://localhost:8554/mystream -map "[img]" -update 1 /dev/shm/snapshot.jpg

Want to send webcam stream to wowza using ffmpeg

I am new to both Wowza and to FFMPEG. I have been testing with ffmpeg and I am able to create local files with video and audio. For example:
ffmpeg -f dshow -i video="HD Pro Webcam C920" myvideo.mpeg
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -pix_fmt yuv420p myvideoandaudio.mp4
What I want to do is send the stream of my webcam to the Wowza server I have installed locally. I have searched several forums, including this one, and have tried multiple commands but still no luck. I would like to have someone point me in the right direction. Following Wowza's instructions, I created a Stream File called mystream, which has a stream UI of udp://0.0.0.0:10100. Also, the application connection settings say that the server's IP is 10.160.XX.XXX and port 1935. I am using Windows, and the "Shared" version of the FFMPEG downloads. I even changed the XML file following the instructions here, trying to send user credentials (during installation, Wowza asked to create credentials if I was going to use streaming):
http://www.wowza.com/forums/content.php?233-How-to-secure-publishing-from-an-RTMP-encoder-that-does-not-support-authentication-(ModuleSecureURLParams)
I have tried all the following commands:
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://localhost:1935/live/mystream
-- failed to connect socket
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://localhost/live/mystream
-- failed to read RTMP packet header
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://10.160.XX.XXX:1935/live/mystream
-- failed to read RTMP packet header
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://10.160.XX.XXX/live/mystream
-- failed to read RTMP packet header
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://127.0.0.1:1935/live/mystream
-- failed to read RTMP packet header
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv rtmp://127.0.0.1/live/mystream
-- writeN, rtmp send error 10053
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920" -f flv -vcodec libx264 -acodec aac -strict -2 rtmp://10.160.XX.XXX:1935/live/ivanstream
-- failed to read RTMP packet header
ffmpeg -f dshow -i video="HD Pro Webcam C920" -vcodec libx264 -tune zerolatency -b:v 900k -pix_fmt yuv420p -f mpegts udp://0.0.0.0:10100
-- conversion failed
ffmpeg -f dshow -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -vcodec libx264 -preset ultrafast -tune zerolatency -r 10 -async 1 -acodec libmp3lame -ab 24k -ar 22050 -bsf:v h264_mp4toannexb -maxrate 750k -bufsize 3000k -f mpegts udp://0.0.0.0:10100
-- conversion failed
ffmpeg -f dshow -i video="HD Pro Webcam C920" -s 512x288 -vcodec libx264 -b:v 1024k -pix_fmt yuv420p -f flv rtmp://127.0.0.1:1935/live/mystream
-- failed to read rtmp packet header
ffmpeg -f dshow -i video="HD Pro Webcam C920" -c:v copy -c:a copy -f flv rtmp://10.160.XX.XXX:1935/live?doPublish=12345/mystream
-- failed to read rtmp packet header
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -r 40 -vcodec libx264 -threads 0 -crf 0 -preset ultrafast -tune zerolatency -f flv rtmp://127.0.0.1:1935/live/mystream
ffmpeg -rtbufsize 1500M -f dshow -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -r 40 -vcodec libx264 -threads 0 -crf 0 -preset ultrafast -tune zerolatency -f flv rtmp://10.160.XX.XXX:1935/live/mystream
-- rtmp header error
ffmpeg -y -f dshow -s 640x480 -r:v 15 -i video="HD Pro Webcam C920":audio="Microphone (Parallels Audio Con" -c:v libx264 -b:v -pix_fmt yuv420p -vb 450 -an -map 0:0 -f rtp rtp://127.0.0.1:10000 -flags +global_header -c:a libvo_aacenc -vn -map 0:1 -f rtp rtp://127.0.0.1:10002 > 10000.sdp
--unable to find suitable output format yuv420p
References:
http://www.wowza.com/forums/showthread.php?25777-Live-Webcam-feed-to-WOWZA-Server-over-RTMP-with-H264-encoding
http://www.factsandpeople.com/facts-mainmenu-5/23-other-software-technologies/258-preventing-real-time-buffer-error-causing-ffmpeg-to-drop-frames-in-screencast
http://www.wowza.com/forums/content.php?233-How-to-secure-publishing-from-an-RTMP-encoder-that-does-not-support-authentication-(ModuleSecureURLParams)
Thank you.

Resources