<div dir="ltr">I have small utility that reads annex-b h264 and adts aac streams from two pipes and writes them to one mp4 container. Both pipes have live streams from v4l2 and alsa devices. As you can see, I added is-live property to fdsrc. Without this property pts and dts of the video stream were corrupted.<br><br><br>#!/bin/sh<br><br>timeout=60<br><br>usage() {<br>    echo "Usage: $(basename $0) [OPTIONS] <VIDEOPIPE> <AUDIOPIPE> <MASK>"<br>    echo "  -o arg (=$timeout) timeout"<br><br>    exit 0<br>}<br><br>OPTIND=1<br><br>while getopts "o:" opt<br><br>do<br>    case $opt in<br>        o)  timeout=$OPTARG<br>            ;;<br>        *)  usage<br>            ;;<br>    esac<br>done<br><br>shift $((OPTIND-1))<br><br>[ $# -ne 3 ] && usage<br><br>video_pipe="$1"<br>audio_pipe="$2"<br>mask="$3"<br><br>exec 3<> "$video_pipe"<br>exec 4<> "$audio_pipe"<br><br>gst-launch-1.0 -qe \<br>    fdsrc fd=3 do-timestamp=true is-live=true \<br>  ! queue \<br>  ! h264parse \<br>  !     video/x-h264,stream-format=<wbr>avc,alignment=au \<br>  ! mux.video \<br>    fdsrc fd=4 do-timestamp=true is-live=true \<br>  ! queue \<br>  ! aacparse \<br>  !     audio/mpeg,stream-format=raw \<br>  ! mux.audio_0 \<br>    splitmuxsink name=mux location="$mask" max-size-time="${timeout}<wbr>000000000"<br><div><br></div><div><br></div><div>The problem is that video and audio streams in mp4 file are not synchronized (or something else). Video looks good, but audio stream has periodically pauses about one second long. There are same pauses in audio stream after remuxing it from mp4 container with audio and video streams to another mp4 container without video stream. But result is good if I first mux only audio stream from audio pipe to mp4 container without video stream. So, I think that video stream affects to this problem.</div><div><br></div><div>I already tryed to set sync property of splitmuxsink to true or false. It did not help.</div></div>