[FFmpeg-user] SDP file to command line arguments

Manuel Malhado mmalhado at agorasystems.com
Mon Jul 1 21:56:47 EEST 2019


Hello,

Using windows version of ffmpeg 4.1.3 here

I'm looking for a way write a ffmpeg command that will allow me to select
the network interface that should be used to capture a video stream being
published in a multicast address

To achieve this, I was thinking on using a udp url with the parameter
*localaddr=addr, *as the ffmpeg command input parameter

I'm trying to replicate a ffmpeg.exe call that has a SDP file as input,
with one that references the udp url.

The SDP file references the multicast address as the stream source, and is
the following:










*v=0o=7230849 1192s=unnamed (mpeg4/tx-1)i=MP-X AUDIO/VIDEO Encoderc=IN IP4
239.xxx.xxx.xxx/64t=0 0m=video 5008 RTP/AVP 98b=AS:2000a=rtpmap:98
MP4V-ES/90000a=fmtp:98
profile-level-id=1;config=000001B005000001B509000001000000012000C490800F50B04241463F*

When I run the command:
*ffserver.exe -protocol_whitelist file,http,https,tcp,tls,rtp,udp -i
<sdp_file>*

I get the expected video, with the following console output:





*Input #0, sdp, from '..\..\mpu001_ch0_dest0.sdp':  Metadata:    title
      : channel_01    comment         : MP-X AUDIO/VIDEO Encoder  Duration:
N/A, start: 0.000000, bitrate: N/A    Stream #0:0: Video: mpeg4 (Simple
Profile), yuv420p, 352x288 [SAR 12:11 DAR 4:3], 25 tbr, 90k tbn, 25 tbc*


The best results I got so far using a udp url as input, were with the
following command:
*ffmpeg.exe -protocol_whitelist file,http,https,tcp,tls,rtp,udp -c mpeg4 -i
udp://239.xxx.xxx.xxx:5000*

but the resulting video has no recognizable elements (I get a "moving
blur"), and i'm getting loads of errors in the console while the video is
being processed:


























*[mpeg4 @ 000000d7694e00c0] warning: first frame is no keyframe[mpeg4 @
000000d7694e00c0] ac-tex damaged at 18 17[mpeg4 @ 000000d7694e00c0] Error
at MB: 409[mpeg4 @ 000000d76954f4c0] Error at MB: 72[mpeg4 @
000000d7694f1800] Error at MB: 76[mpeg4 @ 000000d7694e00c0] concealing 166
DC, 166 AC, 166 MV errors in P frame[mpeg4 @ 000000d76954f4c0] concealing
376 DC, 376 AC, 376 MV errors in I frame[mpeg4 @ 000000d7694f1800]
concealing 372 DC, 372 AC, 372 MV errors in I frame[mpeg4 @
000000d7694e3880] ac-tex damaged at 4 10[mpeg4 @ 000000d7694e3880] Error at
MB: 234[mpeg4 @ 000000d7694e3880] concealing 257 DC, 257 AC, 257 MV errors
in P frame[mpeg4 @ 000000d7694d8800] ac-tex damaged at 1 12[mpeg4 @
000000d7694d8800] Error at MB: 277[mpeg4 @ 000000d7694d8800] concealing 184
DC, 184 AC, 184 MV errors in P frame[mpeg4 @ 000000d7694e00c0] 1. marker
bit missing in 3. esc[mpeg4 @ 000000d7694e00c0] Error at MB: 278[mpeg4 @
000000d7694e3880] 1. marker bit missing in 3. esc[mpeg4 @ 000000d7694e3880]
Error at MB: 72[mpeg4 @ 000000d7694e00c0] concealing 185 DC, 185 AC, 185 MV
errors in P frame[mpeg4 @ 000000d7694e3880] concealing 376 DC, 376 AC, 376
MV errors in I frame[mpeg4 @ 000000d7694e00c0] Error at MB: 92[mpeg4 @
000000d7694e00c0] concealing 357 DC, 357 AC, 357 MV errors in I frame[mpeg4
@ 000000d76954f4c0] ac-tex damaged at 2 7[mpeg4 @ 000000d76954f4c0] Error
at MB: 163[mpeg4 @ 000000d7694d8800] ac-tex damaged at 20 3[mpeg4 @
000000d7694d8800] Error at MB: 89[mpeg4 @ 000000d76954f4c0] concealing 294
DC, 294 AC, 294 MV errors in P frame*
...

The console output for the input description is the following:


*Input #0, m4v, from 'udp://239.2.2.1:5000 <http://239.2.2.1:5000>':
Duration: N/A, start: 32881.360000, bitrate: N/A    Stream #0:0: Video:
mpeg4 (Simple Profile), yuv420p, 352x288 [SAR 12:11 DAR 4:3], 25 tbr, 1200k
tbn, 25 tbc*

The only visible diference between the two input descriptions is the "*tbn"
*value.
I haven't yet found a way to enforce it and i'm not even sure if it would
make any difference in the result.


*Manuel Malhado*
Software Engineer



mmalhado at agorasystems.com
Office (PT): +351 213 162 144
Rua da Cova da Moura, n. 2
<https://maps.google.com/?q=Rua+da+Cova+da+Moura,+n.+2&entry=gmail&source=g> -
3ยบ Esq. | 1350-117 Lisbon - Portugal
www.agorasystems.com
LinkedIn  <https://www.linkedin.com/company/agorasys>| Twitter
<https://twitter.com/SystemsAgora>| Facebook
<http://www.facebook.com/agorasys/>| Youtube
<https://www.youtube.com/user/agorapsim/>


More information about the ffmpeg-user mailing list