Files with delay in video stream

For submission of patches, language translations, discussing implementation of some feature, etc.

Files with delay in video stream

Unread postby soreepeong » Sun Feb 19, 2017 7:42 am

I'm working with a video with one of its stream has >0 start_time. In Aegisub r8898 and latest FFMS2, using the attached video and subtitle, the text seems to be in sync with the video. But in external players like MPC-HC and VLC, they are not in sync; using Shift Times feature by start_time will fix the problem, but then the subtitle is not in sync in Aegisub and it is difficult to work with.
Also, I tried using ffmsindex to generate a timecode file, which resulted in non-zero first pts, and used Open Timecodes File feature, but it did not help. Could it be a bug in Aegisub?

The delay in example file is small, but it goes same for files with >200ms delays.

From ffprobe -show_streams:
[STREAM]
index=0
codec_name=h264
...
timecode=N/A
...
r_frame_rate=24000/1001
avg_frame_rate=24000/1001
time_base=1/24000
start_pts=984
start_time=0.041000
duration_ts=239239
duration=9.968292
bit_rate=764131
[/STREAM]
[STREAM]
index=1
codec_name=ac3
...
time_base=1/48000
start_pts=768
start_time=0.016000
duration_ts=479232
duration=9.984000
[/STREAM]
Attachments
test.7z
video
(877.34 KiB) Downloaded 34 times
test.ass
Subtitle in sync w/ video in Aegisub, but not in other players like mpc-hc
(992 Bytes) Downloaded 35 times
soreepeong
Comic Sans MS
Comic Sans MS
 
Posts: 2
Joined: Sun Feb 19, 2017 7:12 am

Re: Files with delay in video stream

Unread postby soreepeong » Sat Mar 18, 2017 7:07 pm

There's a workaround:
use ffmsindex -c FILENAME to generate a timecode, and then edit the first timecode item of the file to zero. It will let Aegisub properly process video streams with non-zero-PTS first frame.

Like:
Code: Select all
# timecode format v2
212.00
253.70
295.40
337.10


To:
Code: Select all
# timecode format v2
0
253.70
295.40
337.10
soreepeong
Comic Sans MS
Comic Sans MS
 
Posts: 2
Joined: Sun Feb 19, 2017 7:12 am


Return to Development

Who is online

Users browsing this forum: Google [Bot] and 1 guest