I have a pipeline with three threads, similar to the one below:
const char * pipelineStr = "appsrc name=src ! queue ! tee name=t ! "
/* H.264 video */ "queue ! x264enc ! h264parse ! matroskamux ! filesink name=enc_fsink "
/* raw video */ "t. ! queue ! videoconvert ! video/x-raw,format=I420 ! y4menc ! filesink name=raw_fsink"
I am using the two file sink videos to run quality tests with VMAF. However, what I've noticed is that the two videos jitter unpredictably. Therefore, although they start in sync, they end up out of sync after e.g. 30s, which affects my VMAF results.
I would like to have the two processing threads to run in sync, i.e. if one of them experiences any lag, the other one does too, so that the final videos are always in sync. I've tried removing the queues after t., but that stops writing the files altogether, probably because of this:
Pipelines with more than one sink usually need to be multithreaded, because, to be synchronized, sinks usually block execution until all other sinks are ready, and they cannot get ready if there is only one thread, being blocked by the first sink.
Is there any solution to my problem? Or is it impossible to fix this using a gst_parse_lauch() type of pipeline, therefore needing to construct the pipeline one element at a time?