PDA

View Full Version : Audio gets out of sync



john2095
04-13-2011, 05:45 PM
Hi, great product. Took some searching but seems to be exactly what I was looking for.

I'm having issues with playing back some files which are being transcoded; the audio gets out of sync.

When transcoding manually with ffmeg, from memory, I was able to fix the problem simply by specifying "-async" on the command line. Is it possible for me to add this option to the ffmpeg done in Mezzmo?

Or any better solution to ensure the video and audio are in sync is heartily welcome.

eg:

FFmpeg version git-c3897d7, Copyright (c) 2000-2011 the FFmpeg developers
built on Feb 28 2011 10:03:54 with gcc 4.4.2
configuration: --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-mingw32- --enable-static --disable-shared --enable-zlib --disable-ffprobe --disable-ffplay --prefix=/media/windows/ffmpeg --extra-cflags=-U__STRICT_ANSI__ --enable-libmp3lame --enable-libx264 --enable-gpl --extra-libs='-lx264 -lpthread' --enable-runtime-cpudetect
libavutil 50. 39. 0 / 50. 39. 0
libavcodec 52.113. 2 / 52.113. 2
libavformat 52.102. 0 / 52.102. 0
libavdevice 52. 2. 3 / 52. 2. 3
libavfilter 1. 76. 0 / 1. 76. 0
libswscale 0. 12. 0 / 0. 12. 0

Seems stream 0 codec frame rate differs from container frame rate: 23.98 (65535/2733) -> 23.98 (24000/1001)
Input #0, avi, from 'H:\filename.avi':
Metadata:
encoder : VirtualDubMod 1.5.4.1 (build 2178/release)
IAS1 : English
Duration: 00:43:45.03, start: 0.000000, bitrate: 1758 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 720x416 [PAR 1:1 DAR 45:26], 23.98 tbr, 23.98 tbn, 23.98 tbc
Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
At least one output file must be specified

Windows 7 x64 - Mezzmo 2.2.0.0 - Sony Bravia

Paul
04-13-2011, 05:51 PM
Yes, you can modify the <ffmpegadditional> command line in the device profile (SonyBraviaKDL.prf in your case) and add any commands supported by FFmpeg there. The device profiles are located in this folder: http://forum.conceiva.com/showthread.php/467-FAQ-Where-are-device-profiles-located

john2095
04-13-2011, 08:41 PM
Awesome. Strangely enough that worked first go - maybe i got lucky - (I only tested on one problem file so far). Here's wondering why you don't include it by default.

For those who wander this way hints to follow me down this path (ensure audio and video sync when transcoding) might be:

the .prf file is installed read-only so you'll need to go into properties and give yourself write permission

the .prf file is xml; i just added "-async" to the first "<ffmpegadditional>" tag I came across. It just happened to be the format that my TV calls for. There are a number those tags in there for encoding into different formats. I doubt it would hurt to stick the async on the end of all of them. YMMV.


delete all the existing transcoded files. you can do this via the gui "Media Server"->"Transcoding Settings"->"Delete Transcoded Files"


restart mezzmo (just for good measure who knows when it reads those xml files in).


Works for me. Instant _knowledgeable_ support. Great product. And Aussie to boot! Sold.

Paul
04-14-2011, 09:40 AM
Glad it worked and thanks for posting the steps as well!

rsedlik
01-31-2013, 01:08 PM
Glad I found this thread, but I'm unclear on how the line should be written. Should it be:

<ffmpegadditional id="mpeg2_encoding" -async/>

or

<ffmpegadditional id="mpeg2_encoding -async"/>

Paul
01-31-2013, 02:51 PM
Mezzmo v2.7+ has changed since the above posts. All the <ffmpegadditional> sections in device profiles refer to IDs and these IDs are stored in a "FFmpegAdditional.xml" file in the DeviceProfiles folder. So the "<ffmpegadditional id="mpeg2_encoding"/>" line in the device profile refers to the "mpeg2_encoding" section in the "FFmpegAdditional.xml" file. You can edit this XML file to change the ffmpeg commandline for <avcontainer> sections in the device profile.

rsedlik
01-31-2013, 03:34 PM
The problem I'm having is all my files are mp4 and everyone of them is out of sync, I'm using wd live gen 1 profile on win 7 64.

rsedlik
01-31-2013, 03:36 PM
The problem I'm having is all my files are out of sync, they are all mp4 format and I'm using wd live gen 1 profile on win 7 64. Here's the FFmpeg info on one of the files:
ffmpeg version N-45050-g2e59210 Copyright (c) 2000-2012 the FFmpeg developers
built on Oct 5 2012 16:38:47 with gcc 4.6.2 (GCC)
configuration: --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --enable-static --disable-shared --enable-zlib --disable-postproc --prefix=/home/peter/ffmpeg/build/gpl --enable-libmp3lame --enable-libx264 --enable-gpl --extra-libs='-lx264 -lpthread' --enable-runtime-cpudetect --extra-cflags=-I/home/peter/cc/include --extra-ldflags=-L/home/peter/cc/lib --pkg-config=pkg-config --disable-w32threads
libavutil 51. 73.102 / 51. 73.102
libavcodec 54. 63.100 / 54. 63.100
libavformat 54. 29.105 / 54. 29.105
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 19.102 / 3. 19.102
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 16.100 / 0. 16.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'M:\Movies\Behind Enemy Lines.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41
creation_time : 2013-01-17 04:04:10
Duration: 01:45:45.10, start: 0.000000, bitrate: 2053 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p, 1280x720 [SAR 1:1 DAR 16:9], 1952 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc
Metadata:
creation_time : 2013-01-17 04:04:10
handler_name : VideoHandler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, s16, 95 kb/s
Metadata:
creation_time : 2013-01-17 04:04:10
handler_name : SoundHandler
At least one output file must be specified


---> DB Level Info: 31, 578
---> Frame rate: 29.97
---> Aspect ratio: 16:9

Peter
01-31-2013, 04:16 PM
Hi,
Mezzmo should be delivering this file to the device for native playback, so the problem might be in the file's encoding. Can you please try pre-transcoding the file to mpegts to see if this corrects the audio sync problem?

Right-click on the file in Mezzmo and select Pre-Transcode Files..., then check the box for your device and click 'Choose Formats...' and select mpegts then click 'OK' and then check the box to pre-transcode files even if they match the device's supported formats and click 'OK'.

rsedlik
02-01-2013, 03:41 AM
Ok I followed your instructions and it is transcoding now, is it normal to transcode at 40-43 fps?

System Specs:
Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.120830-0333)
BIOS: BIOS Date: 10/12/12 22:16:56 Ver: 04.06.05
Processor: AMD FX(tm)-6100 Six-Core Processor (6 CPUs), ~3.3GHz
Memory: 24576MB RAM
Available OS Memory: 24468MB RAM
Page File: 3487MB used, 45448MB available
Windows Dir: C:\Windows
DirectX Version: DirectX 11

Paul
02-01-2013, 09:39 AM
Mezzmo uses ffmpeg.exe for transcoding video and audio files. Transcoding can be slower depending on the resolution and bitrate of the video (the higher the more processing required) and what format you are transcoding the video to.