3

I am using below command to push the video to Wowza server, since we are pushing raw h264 video, the rtp packet doesnot have the timestamp, and we could observe audio video sync issue while playing video using vlc. While executing the ffmpeg. Command, there is a warning showing as ( rtsp@ Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly)

IS there any option available in ffmpeg to add timestamp in rtp packet and push the video and audio ?

$ffmpeg -f h264 -i /tmp/enc_sd_stream.h264 -f aac -i /tmp/aud_rec_stream  -acodec copy -vcodec copy -r 23 -f rtsp 
 rtsp://shafi:shafi@192.168.1.135:1935/live/myStream

Input #0, h264, from '/tmp/enc_sd_stream.h264': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuv420p, 720x576, 25 fps, 25 tbr, 1200k tbn, 50 tbc Input #1, aac, from '/tmp/aud_rec_stream': Duration: N/A, bitrate: 57 kb/s Stream #1:0: Audio: aac (LC), 32000 Hz, mono, fltp, 57 kb/s [udp @ 0xb7553290] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required) [udp @ 0xb7553320] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required) [udp @ 0xb754c520] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required) [udp @ 0xb758d670] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required) Output #0, rtsp, to 'rtsp://shafi:shafi@192.168.1.135:1935/live/myStream': Metadata: encoder : Lavf57.25.100 Stream #0:0: Video: h264, yuv420p, 720x576, q=2-31, 25 fps, 25 tbr, 90k tbn, 15 tbc Stream #0:1: Audio: aac (LC), 32000 Hz, mono, 57 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #1:0 -> #0:1 (copy) Press [q] to stop, [?] for help [h264 @ 0xb752e2b0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)

[rtsp @ 0xb754bda0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly

[aac @ 0xb75f7880] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8) frame=10213 fps= 14 q=-1.0 Lsize=N/A time=00:06:48.80 bitrate=N/A speed=0.574x

2

The usual solution for this situation: -fflags +genpts

It should eliminate the warning, but there's no guarantee your sync issues will be solved.

  • 1
    This worked better than -use_wallclock_as_timestamps 1 when mashing a pair of avi files together. The resulting file synced up perfectly with the subtitle (.sub & .idx) files I had. – Andrew Beals Nov 12 '18 at 16:26
0

this worked for me as an option to ffmpeg: -use_wallclock_as_timestamps 1

  • 1
    If your read speed is different than stream framerate, output playback speed (and audio sync) will be wrong. Add -re before both video and audio input to avoid that. – Gyan Jul 19 '18 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.