This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5708: GStreamer multiplexing H264 to MP4 playback rate problem

Part Number: AM5708

As shown in the title, I have a test.h264 stream data file locally, use the following command to multiplex H264 into MP4 format video with gstreamer.

gst-launch-1.0 filesrc location=test.h264 ! \
queue ! h264parse ! video/x-h264,stream-format=avc,alignment=au ! \
mp4mux ! filesink location=gst.mp4

I successfully generated the gst.mp4 file and used the following command to play and display, but there is an acceleration problem in the playback of the mp4 file.

gst-launch-1.0 filesrc location=gst.mp4 ! \
qtdemux ! h264parse ! ducatih264dec ! \
vpe ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
kmssink 

I try ffmpeg to mux H264 to MP4, successfully generate mp4 file

ffmpeg -i test.h264 -c:v copy ffmpeg.mp4

Use the following command to play ffmpeg.mp4, the playback rate is ok

gst-launch-1.0 filesrc location=ffmpeg.mp4 ! \
qtdemux ! h264parse ! ducatih264dec ! \
vpe ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
kmssink 

I compared the file information of gst.mp4 and ffmpeg.mp4 and found that gst.mp4 lacks some duration and rate information compared to ffmpeg.mp4


How can gstreamer correctly multiplex H264 into MP4 format? Thanks.

Best Regards,

Gary