Wrong audio and video durations (MOV to MP4 transcoding)

Bug report and feature request
Post Reply
almeidap
Beginner
Beginner
Posts: 6
Joined: Fri Aug 08, 2008 9:48 pm

Wrong audio and video durations (MOV to MP4 transcoding)

Post by almeidap » Wed Aug 20, 2008 10:13 pm

(This thread follows another previous discusion about sound problems in MOV to MP4 transcoding)

After dealing with some problems when converting MOV files (from my Panasonic DMC-TZ5K, HD videos in 1280 x 720 - 30fps) to MP4, I managed to output sound using MEncoder as source and Nero Encoder but now, I'm facing another problem: video and audio durations are not the same, though they are correctly synched.

This bug is reproducible with any other MOV file and about 10% of sound is lost at the end of the movie.

Audio input sample rate is only 8000Hz and resampling to 44100Hz or 48000Hz seems to produce incorrect audio lengths. Using original sample rate, leads to the blocking CPU error! :(

Anyone has a clue or knows how to resolve this problem? (Definitively, MOV format really s***s!)

MediaCoder version: 0.6.1 build 4166

Here are the Details of Transcoded File:
General
Complete name : C:\...\P1000414.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 19.1 MiB
Duration : 1mn 15s
Overall bit rate : 2121 Kbps
Encoded date : UTC 2008-08-15 15:11:20
Tagged date : UTC 2008-08-15 15:11:20

Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L5.1
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Codec ID : avc1
Duration : 1mn 15s
Bit rate mode : Variable
Bit rate : 2048 Kbps
Maximum bit rate : 3335 Kbps
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4/3
Frame rate mode : Constant
Frame rate : 30.000 fps
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.222
Stream size : 18.5 MiB (97%)
Writing library : x264 core 60
Encoding settings : cabac=1 / ref=5 / deblock=1:-2:-1 / analyse=0x3:0x133 / me=esa / subme=7 / brdo=0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=0 / threads=3 / nr=0 / decimate=1 / mbaff=0 / bframes=5 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / bime=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=2048 / ratetol=1.0 / rceq='blurCplx^(1-qComp)' / qcomp=1.00 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=2:1.00
Encoded date : UTC 2008-08-15 15:11:20
Tagged date : UTC 2008-08-15 15:11:21

Audio
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : Yes
Format settings, PS : Yes
Codec ID : 40
Duration : 1mn 8s
Bit rate mode : Variable
Bit rate : 69.3 Kbps
Maximum bit rate : 73.7 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Stream size : 581 KiB (3%)
Encoded date : UTC 2008-08-15 15:11:21
Tagged date : UTC 2008-08-15 15:11:21

User avatar
SirAuron
Expert
Expert
Posts: 798
Joined: Thu Feb 08, 2007 1:39 am
Location: Germany

Post by SirAuron » Thu Aug 21, 2008 7:35 pm

Have you tried using mplayer or ffmpeg as audio sources?
MediaCoder settings:

x264 (backend/source: mencoder, fps: 23,976, Fabio Sonatti's settings) + nero aac 64 in matroska

almeidap
Beginner
Beginner
Posts: 6
Joined: Fri Aug 08, 2008 9:48 pm

Post by almeidap » Thu Aug 21, 2008 10:52 pm

SirAuron wrote:Have you tried using mplayer or ffmpeg as audio sources?
Yes, I tried a lot of audio/video source and encoder combinations! Some combinations lead to the 'blocking CPU' error, others couldn't output any file and finally, some combinations encoded the file correctly... but never with the correct audio length!

FYI, here are the Details of the ORIGINAL file:
General
Complete name : D:\...\P1000139.MOV
Format : QuickTime
Format/Info : Original Apple specifications
File size : 101 MiB
Duration : 1mn 15s
Overall bit rate : 11.2 Mbps
Encoded date : UTC 2008-08-01 18:33:14
Tagged date : UTC 2008-08-01 18:33:14

Video
Format : M-JPEG
Codec ID : jpeg
Duration : 1mn 15s
Bit rate mode : Variable
Bit rate : 11.2 Mbps
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4/3
Frame rate mode : Constant
Frame rate : 30.000 fps
Bits/(Pixel*Frame) : 1.213
Stream size : 101 MiB (99%)
Encoded date : UTC 2008-08-01 18:33:14
Tagged date : UTC 2008-08-01 18:33:14

Audio
Format : PCM
Format settings, Endianness : Little
Format settings, Sign : Unsigned
Codec ID : raw
Duration : 1mn 15s
Bit rate mode : Constant
Bit rate : 64.0 Kbps
Channel(s) : 1 channel
Sampling rate : 8000 Hz
Resolution : 8 bits
Stream size : 590 KiB (1%)
Encoded date : UTC 2008-08-01 18:33:14
Tagged date : UTC 2008-08-01 18:33:14
As you can see, audio and video durations are identical. I think the problem comes from the resampling from 8000Hz to 44100Hz (also tried 48000Hz), which may compute a wrong audio duration.

stanley
Site Admin
Site Admin
Posts: 4135
Joined: Mon May 15, 2006 7:43 pm
Location: Sydney

Post by stanley » Sat Aug 23, 2008 1:54 am

What if resampling not used?
When things work together, things work.

almeidap
Beginner
Beginner
Posts: 6
Joined: Fri Aug 08, 2008 9:48 pm

Post by almeidap » Sat Aug 23, 2008 7:36 pm

stanley wrote:What if resampling not used?
almeidap wrote:Using original sample rate, leads to the blocking CPU error! :(
And forcing resampling to 8000Hz produces the same blocking CPU error. This has been tested on builds 4166 and 4170 without success...

Looking on console logs, I found this interesting line:

Code: Select all

# .\codecs\neroAacEnc.exe -hev2 -q 0.25 [b]-ignorelength[/b] [b]-if -[/b] -of "C:\Users\...\AppData\Local\Temp\mcstream5536.m4a"
Seems that file length is ignored and that input file is not set correctly... but I'm not an expert on command line transcoding.

tosione
Beginner
Beginner
Posts: 8
Joined: Wed Dec 24, 2008 9:16 am

Post by tosione » Wed Dec 24, 2008 9:30 am

I have the DMC-TZ4 and the problem is the same.

Did you finally found any solution for this?

I've found that with "Super" (from ErightSoft) the problem is the same, but activating the DirectShow decode, the problem gets solved.
Is there any similar feature on MediaCoder?
Because I like MediaCoder much more, because of its simple interface, but still all possibilities.

I'll appreciate all help

almeidap
Beginner
Beginner
Posts: 6
Joined: Fri Aug 08, 2008 9:48 pm

Post by almeidap » Wed Dec 24, 2008 7:40 pm

Actually, I found the solution... with another program: TMPGEnc 4.0 XPress! Unfortunately, it is not free but MOV to MP4 conversions are handled perfectly and you can tune video noise or color correction (particularly with dark videos...) even in a batch process.

Nevertheless, I still use MediaCoder for other standard conversions as it is really fast and renders good quality videos. May be this issue has been adressed in release 0.6.2 (not tested yet)...

Post Reply