H264/MP4 files via multifilesink cannot be played in some browsers

We have encountered an issue with the playback of videos that were encoded (H264) on the Jetson NX and saved using the multifilesink plugin. Depending on which system/browser combo someone is using for playback, we are seeing up to a 3-10s delay in the playback of videos.

The following behaviors occur during playback:

  • Ubuntu - all browsers (Firefox / Chrome / Chromium) have good playback for all videos
  • Mac Chrome/Chromium - good playback for 1st video and delayed playback for 2nd/3rd/… video files
  • Mac Safari - good playback for all videos
  • Windows with Edge browser - good playback for 1st video and delayed playback for 2nd/3rd/… video files

To recreate the scenario, you can use the command with the test source below. It writes file after file until interrupted; again the 1st file plays well but subsequent ones have a delay in the beginning during playback on some OS/browser combinations.

gst-launch-1.0 videotestsrc pattern=snow ! 'video/x-raw,width=2560,height=1960,framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)NV12' ! nvv4l2h264enc bitrate=10276044 preset-level="FastPreset" ratecontrol-enable=true ! h264parse ! splitmuxsink max-size-time=10000000000 muxer="qtmux" location=video%02d.mp4

A similar issue occurs with mp4mux as well. Interestingly, videos produced with x264enc plugin (as opposed to the accelerated plugin) do not seem to have the same playback issues.

Thank you for your help!

Hi,
Please try

  1. Enable the property to nvv4l2h264enc
  insert-sps-pps      : Insert H.264 SPS, PPS at every IDR frame
                        flags: readable, writable
                        Boolean. Default: false
  insert-vui          : Insert H.264 VUI(Video Usability Information) in SPS
                        flags: readable, writable
                        Boolean. Default: false
  1. Set IDR interval to small value such as 30 or 60
  idrinterval         : Encoding IDR Frame occurance frequency
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 256
1 Like

Thank you a ton! I am able to play the video without issue in Chrome on Mac.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.