Skip to content

h264parse, h265parse: Resend codec / SPS / PPS info on pipeline reconfig

filipe-norte-red requested to merge filipe-norte-red/gstreamer:main into main

On pipelines build for multi-video track containers using independent parser for each track, but with the decoder element present after an input switch element connected to the parsers, the decoder may not have the correct codec info when a track switch occurs. This can be easily observed when switching between tracks with different resolutions.

Attached video-track-switch.tar package contains small app that reproduces the issue without this fix (and shows it working if fix is applied).

The test samples in this package were generated in the following way:

curl http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 -o BigBuckBunny.mp4
curl http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4 -o ElephantsDream.mp4
curl http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WhatCarCanYouGetForAGrand.mp4 -o WhatCarCanYouGetForAGrand.mp4

ffmpeg -i BigBuckBunny.mp4 -i ElephantsDream.mp4 -fs 25M  -c copy -map 0:v -map 0:a -map 1:v  combined-ok.mp4
ffmpeg -i BigBuckBunny.mp4 -i WhatCarCanYouGetForAGrand.mp4 -fs 25M -c copy -map 0:v -map 0:a -map 1:v  combined-nok.mp4

Merge request reports