[FFmpeg-user] Wrong "profile-level-id" on RTP SDP after transmux from RTMP

asticode contact at asticode.com
Thu Oct 18 11:14:23 EEST 2018


Hey Carl,

When I encode directly in RTP/SDP, I don't see the profile-level-id provided
therefore I can't validate whether this is working or not.

Here are my commands and their outputs:

1) Encode in RTMP

ffmpeg -re -f lavfi -i "testsrc2=size=1280x720:rate=25" -pix_fmt yuv420p
-c:v libx264 -g 50 -keyint_min 50 -b:v 4M -tune zerolatency -profile:v
baseline -level:v 3.1 -preset veryfast -bf 0 -refs 3 -sc_threshold 0 -vf
"drawtext=text='%{localtime\:%T}':x=(w-tw)/2:y=(h-lh)/2:fontfile=arial.ttf:fontsize=100:box=1"
-f flv rtmp://127.0.0.1/test
ffmpeg version N-92192-g57f312a Copyright (c) 2000-2018 the FFmpeg
developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
  configuration: --prefix=.. --enable-libx264 --enable-gpl
--enable-libfreetype --enable-libopus --enable-libvpx
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 33.100 / 58. 33.100
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, lavfi, from 'testsrc2=size=1280x720:rate=25':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720 [SAR
1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7f8009002400] using SAR=1/1
[libx264 @ 0x7f8009002400] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7f8009002400] profile Constrained Baseline, level 3.1
[libx264 @ 0x7f8009002400] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options:
cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=2 psy=1
psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=8
lookahead_threads=8 sliced_threads=1 slices=8 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=50
keyint_min=26 scenecut=0 intra_refresh=0 rc=abr mbtree=0 bitrate=4000
ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://127.0.0.1/test':
  Metadata:
    encoder         : Lavf58.19.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p,
1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 4000 kb/s, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.33.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/4000000 buffer size: 0 vbv_delay: -1
frame=  355 fps= 25 q=23.0 size=    7018kB time=00:00:14.16
bitrate=4059.9kbits/s speed=0.998x

2) Transmux in RTP/SDP

ffmpeg -i rtmp://127.0.0.1/test -c copy -f rtp rtp://127.0.0.1:4002
ffmpeg version N-92192-g57f312a Copyright (c) 2000-2018 the FFmpeg
developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
  configuration: --prefix=.. --enable-libx264 --enable-gpl
--enable-libfreetype --enable-libopus --enable-libvpx
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 33.100 / 58. 33.100
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, flv, from 'rtmp://127.0.0.1/test':
  Metadata:
    Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
    displayWidth    : 1280
    displayHeight   : 720
    fps             : 25
    profile         :
    level           :
  Duration: 00:00:00.00, start: 162.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive),
1280x720 [SAR 1:1 DAR 16:9], 3999 kb/s, 25 fps, 25 tbr, 1k tbn, 50 tbc
Output #0, rtp, to 'rtp://127.0.0.1:4002':
  Metadata:
    Server          : NGINX RTMP (github.com/arut/nginx-rtmp-module)
    displayWidth    : 1280
    displayHeight   : 720
    fps             : 25
    profile         :
    level           :
    encoder         : Lavf58.19.100
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive),
1280x720 [SAR 1:1 DAR 16:9], q=2-31, 3999 kb/s, 25 fps, 25 tbr, 90k tbn, 25
tbc
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 58.19.100
m=video 4002 RTP/AVP 96
b=AS:3999
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;
sprop-parameter-sets=Z0LAH9kAUAW7ARAAAAMAEAAAAwMo8YMkgA==,aMuPIA==;
profile-level-id=42C01F

Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=  374 fps= 38 q=-1.0 size=    7367kB time=00:00:14.92
bitrate=4045.0kbits/s speed=1.51x

3) Only because you asked, here's when I encode directly in RTP/SDP

ffmpeg -re -f lavfi -i "testsrc2=size=1280x720:rate=25" -pix_fmt yuv420p
-c:v libx264 -g 50 -keyint_min 50 -b:v 4M -tune zerolatency -profile:v
baseline -level:v 3.1 -preset veryfast -bf 0 -refs 3 -sc_threshold 0 -vf
"drawtext=text='%{localtime\:%T}':x=(w-tw)/2:y=(h-lh)/2:fontfile=arial.ttf:fontsize=100:box=1"
-f rtp rtp://127.0.0.1:4002
ffmpeg version N-92192-g57f312a Copyright (c) 2000-2018 the FFmpeg
developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
  configuration: --prefix=.. --enable-libx264 --enable-gpl
--enable-libfreetype --enable-libopus --enable-libvpx
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 33.100 / 58. 33.100
  libavformat    58. 19.100 / 58. 19.100
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.101 /  7. 33.101
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, lavfi, from 'testsrc2=size=1280x720:rate=25':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720 [SAR
1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7fd72c804c00] using SAR=1/1
[libx264 @ 0x7fd72c804c00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fd72c804c00] profile Constrained Baseline, level 3.1
Output #0, rtp, to 'rtp://127.0.0.1:4002':
  Metadata:
    encoder         : Lavf58.19.100
    Stream #0:0: Video: h264 (libx264), yuv420p, 1280x720 [SAR 1:1 DAR
16:9], q=-1--1, 4000 kb/s, 25 fps, 90k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.33.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/4000000 buffer size: 0 vbv_delay: -1
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 58.19.100
m=video 4002 RTP/AVP 96
b=AS:4000
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1

frame=  202 fps= 25 q=25.0 size=    4065kB time=00:00:08.04
bitrate=4142.1kbits/s speed=0.995x

Let me know whether you need anything else.

Cheers



--
Sent from: http://www.ffmpeg-archive.org/


More information about the ffmpeg-user mailing list