Problem with audio sync of .ts files

lpl1990

New member
When I cut .ts files, I found that it ignores the original audio delay value of the .ts files during output, resulting an output file with an incorrect audio and video sync.
 
Last edited:

Dan203

Ex-Senior Developer
Try running the file through Quick Stream Fix before editing it. Also make sure you're running the newest release.
 

Danr

Administrator
When I cut .ts files, I found that it ignores the original audio delay value of the .ts files during output, resulting an output file with an incorrect audio and video sync.
Can you provide us with more specifics such as:

1) Where did the file come from?
2) Is the sync error large or small?
3) Does it increase across the file?
4) A copy of Tools>Show Program Info (there's a copy button in the lower left of that dialog).
5) What version are you running (Help>About)?
6) Did Tools>QuickStream fix also result in a sync issue or only when you make cuts?
7) Does it happen on all files or just specific ones?
 

lpl1990

New member
Can you provide us with more specifics such as:

1) Where did the file come from?
2) Is the sync error large or small?
3) Does it increase across the file?
4) A copy of Tools>Show Program Info (there's a copy button in the lower left of that dialog).
5) What version are you running (Help>About)?
6) Did Tools>QuickStream fix also result in a sync issue or only when you make cuts?
7) Does it happen on all files or just specific ones?
1) TV Recording.

2) The sync error varies on different source file, generally not very large.

3) It remains the same for the same output file.

4)
File: Name : *:\***\2013_03-10_00-03-46_J2_Sword Art Online.ts
Size : 1.029 GB
Duration : 00:27:48.24
Mux type : TS Stream
TS mux rate : 4.626 Mbps
Video: Encoding : H.264
VideoStreamID : x335
Frame rate : 25.00 fps
Encoding size : 1920 x 1080
Aspect ratio : 16:9
Header bit rate : 20.000 Mbps
VBV buffer : 380 KBytes
Profile : High/4.0
Progressive : Interlaced
Chroma : 4:2:0
Entropy mode : CABAC
Bit rate : 4.370 Mbps
Audio Stream: 1 (Primary) Codec : AC3
Format : AC3 stream
Channels : 2.0
PID : x336
PES Stream Id : xBD
Bit rate : 192 Kbps
Sampling rate : 48000
Sample size : 16 bits
Audio Stream: 2 Codec : AC3
Format : AC3 stream
Channels : 2.0
PID : x337
PES Stream Id : xBD
Bit rate : 192 Kbps
Sampling rate : 48000
Sample size : 16 bits
Subtitle: 1-1 Type : DVB Subpic
PID : 0x339
Language : CHI
Page : 1

==============================================================================================

General #1
ID : 1 (0x1)
Complete name : *:\***\2013_03-10_00-03-46_J2_Sword Art Online.ts
Format : MPEG-TS
File size : 981 MiB
Duration : 27mn 49s
Overall bit rate mode : Variable
Overall bit rate : 4 932 Kbps
Video #821
ID : 821 (0x335)
Menu ID : 82 (0x52)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=3, N=12
Codec ID : 27
Duration : 27mn 49s
Bit rate : 4 301 Kbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.083
Stream size : 856 MiB (87%)
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio #822
ID : 822 (0x336)
Menu ID : 82 (0x52)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : 6
Duration : 27mn 49s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -760ms
Stream size : 38.2 MiB (4%)
Audio #823
ID : 823 (0x337)
Menu ID : 82 (0x52)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : 6
Duration : 27mn 49s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -797ms
Stream size : 38.2 MiB (4%)
Text #825
ID : 825 (0x339)
Menu ID : 82 (0x52)
Format : DVB Subtitle
Codec ID : 6
Language : Chinese

5) 4.21.1.655

6) The program can read the audio delay info correctly, but cannot handle it correctly in the output file. This situation is reflected in audio display.

7) It happens in all .ts files.
 
Last edited:

Danr

Administrator
Was that information from the source or edited output file?

When you play the edited file back does the audio sound way out of sync or are you going by the MediaInfo?
 

lpl1990

New member
Was that information from the source or edited output file?

When you play the edited file back does the audio sound way out of sync or are you going by the MediaInfo?
This is from the source file.

During the playback of the edited file, the audio sound way out of sync, although not always obvious.
 
Last edited:

lpl1990

New member
I have uploaded the file and sent the email some days ago. Hope that you could have a deeper investigation on the issue.
 

Danr

Administrator
I didn't see a sync issue with your source file, but have sent you an email requesting additional info.
 

hydra3333

Member
Hello. I am just seeing what looks like this issue in VRD v5 from captured .TS files containing h264 and ac3 and run through QSF to turn it into mp4. Around .25s out of sync when played (original .TS was auto deleted).
The .TS files with qsf mpeg2.TS -> mpeg2.mpg seem OK though ?
Looked at some newer .TS file captures and mediainfo reports the delays are all over the place, nothing consistent.
Found a .TS with 1800ms audio delay according to mediainfo and will run some tests.
"Delay relative to video : -1 s 824 ms"
 

Danr

Administrator
If you smart cut a video you can't trust the MediaInfo delay. It's totally incorrect in it's calculation. Are you hearing the problem when playing back?
 

hydra3333

Member
Hello Dan.
The problem is clearly evident in playback ... but not in the .mp4 file produced by the QSF from the .TS file.

It's on another .mp4 output from ffmpeg after the "qsf'd into mp4" file is processed by ffmpeg.
Playback .TS file = OK.
Playback .mp4 file from qsf = OK.
Playback .mp4 file arising from any type of ffmpeg audio conversion from the qsf .mp4 file and then mp4box muxing with the video to a new .mp4 = terrible sync.

For playback device compatibility reasons I need to convert .TS files with AC3 or MP2 etc audio into a .mp4 containing a single MP3 standard audio format (and adjust loudness to a common standard at the same time).
Devices = WDTVs of older generation, and chromecast 1 and Ultru.
At the moment I'm using ffmpeg's loudnorm audio filter and ignoring any "delay" and then noticing the out of sync in playback with MPC-HC.

mediainfo on the original .TS file shows a heap of things including "Delay relative to video : -1 s 824 ms".
mediainfo on the .mp4 file output from QSF shows only this for the audio section, as if most metadata including "delay" had gone.
Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : ac-3
Duration : 54 min 50 s
Bit rate mode : Constant
Bit rate : 384 kb/s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 spf)
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 151 MiB (9%)
Language : English
Default : Yes
Alternate group : 1
For the record, does VRD QSF adjust the audio so there's 0 delay, as it qsf's into the .mp4 file ?
If not mediainfo, what better tool shoulod I user to check for "delay", given the above ?

Unless the latest ffmpeg is mucking up audio conversion greatly, or mp4box is mucking up video/audio muxing greatly, I am unsure where else to look.

I reckon I may open VRD again and see what my audio conversion/normalisation options are during the QSF from .TS to .mp4 in the meantime.
 
Top Bottom