-
Hello! I catch an RTSP stream with audio and video tracks from the server and save it to .ts files. There were no problems with the video with the H264 codec, following the “client-read-format-h264-save-to-disk” example, I form packets and write them to a file. But I can't figure out how to do this with an AAC codec audio track (defined as MPEG4Audio) and how to sync it with the video. Similarly, I tried to create a stream using AddElementaryStream, ElementaryPID=255, StreamType=astits.StreamTypeAACAudio, and there is a track in the file, but its codec in VLC (ADTS) is different from the original one (MPEG AAC Audio). Tell me, please, how can I save both tracks to files? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello, a full MPEG-TS muxer is available in mediacommon: In particular:
|
Beta Was this translation helpful? Give feedback.
-
is there any example on how to save audio and video in the same .ts file ? |
Beta Was this translation helpful? Give feedback.
Hello, a full MPEG-TS muxer is available in mediacommon:
https://github.com/bluenviron/mediacommon/blob/main/pkg/formats/mpegts/writer.go
In particular: