I have a sync problem when I try to burn subtitle movie. Start of the output movie sync is good but end of it audio comes a few second ago than video.
I tried wmav1 , wmav2 and mp3 audio codecs in Mencoder.
How to I fix it?
My command:
The source infos:Code:mencoder.exe -mc 0 -priority idle -vid 0 -vf-add scale=1920:1080 -ovc x264 -x264encopts bitrate=3500:threads=auto:preset=veryfast:tune=film -of avi -subfont-autoscale 3 -subfont-blur 2 -subfont-outline 3 -font Arial -subcp UTF-8 -subpos 96 -subfont-text-scale 3 -sub "C:\Users\servet\Desktop\log\mark.srt" -oac mp3lame -lameopts abr:br=256 -channels 2 -delay 0 -o "C:\Users\servet\Desktop\output.avi" "C:\Users\servet\Desktop\source.mp4"
Code:Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 5.17 GiB Duration : 1h 44mn Overall bit rate mode : Variable Overall bit rate : 7 108 Kbps Encoded date : UTC 2015-01-27 09:14:23 Tagged date : UTC 2015-01-27 09:14:23 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High@L4.1 Format settings, CABAC : Yes Format settings, ReFrames : 5 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 1h 44mn Bit rate : 6 850 Kbps Maximum bit rate : 18.2 Mbps Width : 1 920 pixels Height : 816 pixels Display aspect ratio : 2.35:1 Frame rate mode : Constant Frame rate : 25.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.175 Stream size : 4.98 GiB (96%) Writing library : x264 core 142 r2431 ac76440 Encoding settings : cabac=1 / ref=5 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=umh / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=30 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=2 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=5 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=6850 / ratetol=1.0 / qcomp=0.60 / qpmin=1 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=62500 / vbv_bufsize=78125 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 Encoded date : UTC 2015-01-27 09:09:05 Tagged date : UTC 2015-01-27 09:15:52 Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 1h 44mn Bit rate mode : Variable Bit rate : 252 Kbps Maximum bit rate : 260 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Compression mode : Lossy Delay relative to video : 160ms Stream size : 188 MiB (4%) Language : English Encoded date : UTC 2015-01-27 09:15:42 Tagged date : UTC 2015-01-27 09:15:52
+ Reply to Thread
Results 1 to 4 of 4
-
-
My smart tv doesn't support a lot of codecs so I have to convert wmav1 , 2 or mp3. I tried faac, it converted very lossy.
-
Ok, here is what I did to have PS3 mencoder media streamed properly and with audio synced:
This site was my base: http://mediatomb.cc/dokuwiki/transcoding:transcoding
But the audio was out of sync, so I altered their script like this:
#!/bin/bash
srt="$1"
output="$2"
# filename must be of the form "movie name.XX[X].srt" or "movie name.srt"
base_name="$(echo $srt | sed 's/\..\{2,3\}\.srt$//' | sed 's/\.srt$//')"
extensions="avi mp4 mpg mov"
for ext in $extensions ; do
input=$base_name.$ext;
if [[ -e $input ]]; then break; fi
done
exec mencoder "$input" \
-oac lavc -ovc lavc -of mpeg \
-ofps 24000/1001 \
-lavcopts vcodec=mpeg1video:keyint=15:vbitrate=1800:vrc_maxr ate=2500:vrc_buf_size=917 \
-mpegopts tsaf:vbitrate=5800:muxrate=7500 -noskip -mc 0 \
-vf harddup \
-sub "$srt" -subcp enca:gr:iso-8859-1 \
-font "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf" -subfont-autoscale 2 \
-o "$output"
So, explaining:
subcp for the proper encoding of the subtitles. It's optional if you are using UTF-8 files.
The quality setting in vcodec option are for VCD videos. You can change it to DVD, if you want.
The 24000/1001 value in ofps changes the frame rate. I don't know if it's important, but it worked for me.
Hope it helps.Last edited by UniverseMaster; 15th Apr 2015 at 06:54. Reason: Changing vcodec parameter mpeg2video to mpeg1video. PS3 only recognizes mpeg1video. Tested OK.