Skip to content

backporting enhanced-rtmp#3

Draft
chenxiaoqiang03 wants to merge 23 commits intoliuqi/4.4from
cxq/backport_enhanced_rtmp
Draft

backporting enhanced-rtmp#3
chenxiaoqiang03 wants to merge 23 commits intoliuqi/4.4from
cxq/backport_enhanced_rtmp

Conversation

@chenxiaoqiang03
Copy link
Collaborator

  • avformat/flvenc: support mux hevc in enhanced flv
  • avformat/flvdec: support demux hevc in enhanced flv
  • avformat/flvenc: support mux av1 in enhanced flv
  • avformat/flvdec: support demux av1 in enhanced flv
  • avformat/flvenc: support mux vp9 in enhanced flv
  • avformat/flvdec: support demux vp9 in enhanced flv
  • avformat/flv: correct the video frametype mask to 0x70
  • tests/fate/flvenc: add hevc in enhanced flv test case
  • avformat/av1: Add a parameter to av1c to omit seq header
  • avformat/vpcc: parse bitstream data to get profile and bitdepth
  • avformat/vpcc: fix VP9 metadata in FLV and RTMP
  • avformat/rtmppkt: add ff_amf_write_array for write
  • tests/fate/flvenc: add vp9 in enhanced flv test case
  • tests/fate/flvenc: add av1 in enhanced flv test case
  • fate/enhanced-flv-vp9: add tests reference data
  • avcodec/av1dec: don't set aspect ratio when it's not yet known
  • avformat/flvdec: handle exheader fourcc correctly in metadata
  • fix bug
  • Revert "avformat: add qy prefix apis"
  • Revert "tests/fate/flvenc: add av1 in enhanced flv test case"
  • Revert "tests/fate/flvenc: add vp9 in enhanced flv test case"
  • Revert "fate/enhanced-flv-vp9: add tests reference data"
  • Revert "tests/fate/flvenc: add hevc in enhanced flv test case"

T-bagwell and others added 23 commits February 5, 2024 19:55
Tested-by: Tristan Matthews <tmatth@videolan.org>
Tested-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Tristan Matthews <tmatth@videolan.org>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Tested-by: Tristan Matthews <tmatth@videolan.org>
Tested-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Tristan Matthews <tmatth@videolan.org>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Tested-by: Tristan Matthews <tmatth@videolan.org>
Tested-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Tristan Matthews <tmatth@videolan.org>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Tested-by: Tristan Matthews <tmatth@videolan.org>
Tested-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Tristan Matthews <tmatth@videolan.org>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Tested-by: Tristan Matthews <tmatth@videolan.org>
Tested-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Tristan Matthews <tmatth@videolan.org>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Tested-by: Tristan Matthews <tmatth@videolan.org>
Tested-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Tristan Matthews <tmatth@videolan.org>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
because the flv specification said the video frametype
should use value range from 0x00 to 0x70,
so use 0xF0 have no problem before support enhanced flv,
but the 0xF0 will get incorrect result after support enhanced flv,
so should set the video frametype mask 0x70 to make it correct now.

Reported-By: flvAnalyser <hybase@qq.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Add a parameter to omit seq header when generating the av1C atom.

For now, this does not change any behavior. This will be used by a
follow-up patch to add AVIF support.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Profile can be derived from values codecpar pixel format only with software
formats. For hardware formats, we're forced to parse a frame header to get
the required information.

Signed-off-by: James Almer <jamrial@gmail.com>
In order to send VP9 tracks with FLV or RTMP, the enhanced RTMP
specification tells that VPCodecConfigurationRecord, a.k.a. vpcC
ISO-BMFF box, must be inserted into a metadata message. However, the
function responsible for generating vpcCs currently returns invalid
boxes, that are lacking the Version and Flag fields, inherited from
FullBox. For some reason, both flags were being added manually in
movenc. This patch fixes the issue.

Signed-off-by: Alessandro Ros <aler9.dev@gmail.com>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Makes the output of the native decoder consistent with external decoders like
libdav1d with fate-enhanced-flv-av1.

Reviewed-by: Zhao Zhili <quinkblack@foxmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
In metadata fourcc is carried in the AMF number, not as binary.

Partially based on a patch by Steven Liu.

Signed-off-by: Marton Balint <cus@passwd.hu>
@feuvan
Copy link

feuvan commented Feb 6, 2024

Manual test

SRS:

git clone https://github.com/ossrs/srs.git
cd srs/trunk && ./configure --h265=on && make
./objs/srs -c conf/hevc.flv.conf

Streaming:

check https://ossrs.net/lts/en-us/blog/push-hevc-via-rtmp-by-obs OBS part

Playback:

./ffplay -v info http://127.0.0.1:8080/live/livestream.flv

Result:

ffplay version n4.4.4-45-gb45d97a6b4 Copyright (c) 2003-2023 the FFmpeg developers
built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
configuration:
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
Input #0, flv, from 'http://127.0.0.1:8080/live/livestream.flv':
Metadata:
fileSize : 0
audiochannels : 2
2.1 : false
3.1 : false
4.0 : false
4.1 : false
5.1 : false
7.1 : false
encoder : obs-output module (libobs version 30.0.2)
server : SRS/6.0.113(Hang)
server_version : 6.0.113
Duration: N/A, start: 0.017000, bitrate: 2723 kb/s
Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 163 kb/s
Stream #0:1: Video: hevc (Main), yuv420p(tv, bt709), 1920x1080, 2560 kb/s, 60 fps, 60 tbr, 1k tbn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants