How to generate an SDP file from FFMPEG

So, I worked with FFMPEG in a project that includes streaming video from one computer to another over the Internet with RTP. I want to take this in ffmpeg and use ffserver to display it on the local network.

As I understand it, you need to have SDP information so that the receiving ffmpeg instance can interpret the RTP stream. Despite what the webpages say, I cannot find the SDP information in the information printed on the console.

How can I make the sending instance of ffmpeg output SDP information so that I can use it to configure my receiving end?

I am testing Windows 7 now, but the final solution will be on Linux.

The command that I run for testing is

ffmpeg -fflags +genpts -i files\2005-SFSD-sample-mpeg1.mpg -threads 0 -r 10 -g 45 -s 352x240 -deinterlace -y 2005.mp4 -an -threads 0 -r 10 -g 45 -s 352x240 -deinterlace -f rtp rtp://192.168.200.198:9008 

My ffmpeg info ...

 ffmpeg version 0.8, Copyright (c) 2000-2011 the FFmpeg developers built on Jun 23 2011 14:22:23 with gcc 4.5.3 configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib --disable-outdev=sdl libavutil 51. 9. 1 / 51. 9. 1 libavcodec 53. 7. 0 / 53. 7. 0 libavformat 53. 4. 0 / 53. 4. 0 libavdevice 53. 1. 1 / 53. 1. 1 libavfilter 2. 23. 0 / 2. 23. 0 libswscale 2. 0. 0 / 2. 0. 0 libpostproc 51. 2. 0 / 51. 2. 0 
+6
source share
4 answers

fooobar.com/questions/911885 / ... explains in more detail how to make a .sdp file, and how to transfer it to ffplay .

+4
source

Usually, when the output is a single rtp stream, ffmpeg displays the sdp information in the console, so you just need to redirect it (and then use sdp):

 ffmpeg -fflags +genpts -i files\2005-SFSD-sample-mpeg1.mpg -an -threads 0 -r 10 -g 45 -s 352x240 -deinterlace -f rtp rtp://192.168.200.198:9008 > config.sdp 

But from your team it seems that you want to make one encoding for two outputs ... if two outputs are rtp (useful for video + audio), it works fine, but I could not get it to print sdp when 1 output is rtp and another mp4 ... not sure if possible

In any case, what you can do is to generate the sdp file for the first time and until you change the video characteristics (resolution format ...) or the rtp address, this sdp file will be valid and your previous command will work with her!

hope this helps

+1
source

Just in case, someone was looking for how to do this using ffmpeg C code, you can use av_sdp_create to generate the av_sdp_create string

+1
source

FFMPG generates an SDP file if specified -sdp_file path/to/file

Excerpt from the documentation:

-sdp_file file (global) Print sdp information for an output stream to file. This allows dumping sdp information when at least one output isn't an rtp stream. (Requires at least one of the output formats to be rtp).

0
source

Source: https://habr.com/ru/post/911883/


All Articles