xtne6f / tsmemseg

In-memory transport stream segmenter mainly for HLS/LL-HLS
MIT License
8 stars 0 forks source link

VPS,SPS,PPS not fully accumulate #2

Open marakew opened 2 months ago

marakew commented 2 months ago

iam again

do you think VPS SPS PPS can be only once per PES ? no is can split per PES as example i have AVC PES stream AUD[2],SPS[23],PPS[4],PPS[95],PPS[5],SEI[8],I(1)Slice(7)[40793]

per AVC/HEVC Config Record VPS can be 15 counts SPS can be 31 counts PPS can be 255 counts

so i think place where assign VPS,SPS,PPS should be impove or reimplement

m_vps.assign(nal, nal + len);
ParseVps(m_vps);

as example, this is wrong it should accumulate ber counts, after counts overflow, should ParseXXX

yes, usefull info which used for produce mp4 can be at first VPS,SPS,PPS counts, but anyway it can make incorrect parameterChanged = true;

xtne6f commented 2 months ago

As you say, especially for PPS, it should be accumulated each pic_parameter_set_id separately. I don't know if there are any practical examples of using multiple VPS/SPS.

The problem is that Fragmented MP4 seems not to support multiple PPS. I have looked into related stackoverflow, and there appears to be multiple (probably unofficial) ways to do it.

https://stackoverflow.com/questions/61190529/fragmented-mp4-video-with-multiple-sets-of-sps-and-pps-with-avcc-encoding https://stackoverflow.com/questions/20682275/h264-with-multiple-pps-and-sps

marakew commented 2 months ago

hardware dvb encoder can produce this

as example terra

vps,sps,pps store at VisualSampleEntry of mp4 as ConfigurationRecord

just move check the same and analyze out of from ParseNals function

inside the function just accumulate

xtne6f commented 3 weeks ago

Sorry for my long silence. I have just released master-240608 for other commits.

I want to fix about this issue, but currently I don't know how to generate or get a stream with multiple PPS. If you have any information, please let me know (FFmpeg commands, sample URLs, etc..)

marakew commented 3 weeks ago

https://trac.ffmpeg.org/ticket/6864