New Process and Issues
I'm starting with DVCPro Sony AVI files (Analog hi8 -> Digital AVI) already transcribed. I have imported multiple AVIs into a VS 2021 project and am creating a single MP4 file as output.
In the project, the video and audio play without any issue (ignoring the sporadic segments of degradation of the original tape footage). The audio seems in-sync with the video.
After exporting as a single mp4 video file, the audio is seconds ahead of the video. My initial thought: in the original video, the microphone cut out for multiple segments of video, so I figured that compression to shortened the audio track as a result. A second project, however, also had this sync issue even though microphone recorded without issue for all segments in the video.
Of course, VS21 wants to produce variable data rate files, so the output mp4 file is both out of audio sync and hard to play continuous. But even after using Handbrake to a re-encode to a constant data rate, the audio is still out of sync.
Old Method which worked without issue
When working on a previous project, I used video files that were already converted to MP4 (constant data rate) by Handbrake from the original AVIs. I then rendered them to a single (variable data rate) MP4 with VS and re-encoded back to constant frame rate. (And used Drax to add chapters in the metadata of the mp4 files).
As you can see, that is way too many steps plus a significant quantity of time and space is required with such a process.
Questions
Is there a way to force VS to produce constant data rate MP4s?
Do you have any solutions for avoiding audio sync problems with the AVI->MP4 compression?
MediaInfo with New Pipeline
Original AVI
Code: Select all
Format : AVI
Format/Info : Audio Video Interleave
Commercial name : DVCPRO
Format profile : OpenDML
File size : 20.8 GiB
Duration : 1 h 40 min
Overall bit rate mode : Constant
Overall bit rate : 29.8 Mb/s
Video
ID : 0
Format : DV
Commercial name : DVCPRO
Codec ID : dvsd
Codec ID/Hint : Sony
Duration : 1 h 40 min
Bit rate mode : Constant
Bit rate : 24.4 Mb/s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Original frame rate : 29.970 (29970/1000) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:1:1
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Bottom Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 2.357
Stream size : 20.1 GiB (97%)
Audio
ID : 1
Format : PCM
Format settings : Little / Signed
Codec ID : 1
Duration : 1 h 40 min
Bit rate mode : Constant
Bit rate : 1 024 kb/s
Channel(s) : 2 channels
Sampling rate : 32.0 kHz
Bit depth : 16 bits
Stream size : 733 MiB (3%)
Alignment : Aligned on interleaves
Interleave, duration : 33 ms (1.00 video frame)Code: Select all
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (mp41/mp42)
File size : 6.50 GiB
Duration : 3 h 52 min
Overall bit rate mode : Variable
Overall bit rate : 3 995 kb/s
Encoded date : UTC 2021-08-20 03:57:15
Tagged date : UTC 2021-08-20 03:57:15
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3
Format settings : 2 Ref Frames
Format settings, CABAC : No
Format settings, Reference frames : 2 frames
Format settings, GOP : M=1, N=15
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3 h 52 min
Source duration : 3 h 52 min
Bit rate mode : Variable
Bit rate : 3 740 kb/s
Maximum bit rate : 4 000 kb/s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 30.000 FPS
Minimum frame rate : 29.762 FPS
Maximum frame rate : 30.242 FPS
Original frame rate : 29.970 (30000/1001) FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.361
Stream size : 6.08 GiB (94%)
Source stream size : 6.08 GiB (94%)
Language : English
Encoded date : UTC 2021-08-20 03:57:15
Tagged date : UTC 2021-08-20 03:57:15
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 3 h 52 min
Bit rate mode : Constant
Bit rate : 256 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 427 MiB (6%)
Language : English
Encoded date : UTC 2021-08-20 03:57:15
Tagged date : UTC 2021-08-20 03:57:15Code: Select all
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp42/iso2/avc1/mp41)
File size : 3.55 GiB
Duration : 3 h 52 min
Overall bit rate mode : Variable
Overall bit rate : 2 182 kb/s
Encoded date : UTC 2021-08-20 05:25:25
Tagged date : UTC 2021-08-20 22:24:17
Writing application : HandBrake 1.4.1 2021081500
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.1
Format settings : CABAC / 5 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 5 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3 h 52 min
Bit rate : 1 921 kb/s
Width : 534 pixels
Height : 478 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.251
Stream size : 3.12 GiB (88%)
Writing library : x264 core 163 r3059 b684ebe0
Encoding settings : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=2 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=15 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=300 / keyint_min=30 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=14000 / vbv_bufsize=14000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2021-08-20 05:25:25
Tagged date : UTC 2021-08-20 05:25:25
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Menus : 3
Codec configuration box : avcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 3 h 52 min
Source duration : 3 h 52 min
Bit rate mode : Variable
Bit rate : 255 kb/s
Maximum bit rate : 376 kb/s / 255 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 44.1 kHz
Frame rate : 43.066 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 424 MiB (12%)
Source stream size : 424 MiB (12%)
Title : Stereo
Language : English
Default : Yes
Alternate group : 1
Encoded date : UTC 2021-08-20 05:25:25
Tagged date : UTC 2021-08-20 05:25:25
mdhd_Duration : 13970495
Menu
ID : 3
Codec ID : text
Duration : 3 h 52 min
Encoded date : UTC 2021-08-20 22:24:17
Tagged date : UTC 2021-08-20 22:24:17
Menu For : 1
00:00:00.000 : Jan-Feb 1992
00:10:38.000 : Baseball Games
01:19:47.000 : Easter 1992
01:29:22.000 : Chris 12th Birthday
01:37:27.000 : Summer 1992
01:53:01.000 : Blue Angels 1992
02:18:05.000 : Nov 1992
02:58:22.000 : Thanksgiving 1992
03:06:13.000 : Christmas 1992