View Full Version : Wrong video time/duration


wuemura
18th July 2009, 15:19
Hello!

I use x264 to convert my videos and upload to my youtube account (http://www.youtube.com/user/coisasquegosto) by some time now. The version I was using was 1140, after I've upgraded to 1173 and the last 1181 I'm getting very strange effects with videos with 23.97fps.

After you upload a 10:00 minutes video, youtube detect as 20:00, in my computer all players I have detect the time right but this problems started to happen with 1173 and now with 1181, the previous 1140 works just fine.

I capture my videos with CANOPUS ADVC-110, edit with virtualdub + avisynth. The command that I use to convert the video is listed below:

x264.exe --thread-input --crf 22 --ref 3 --mixed-refs --bframes 16 --b-pyramid --weightb --trellis 1 --deblock -1:-1 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --threads 2 --sar 40:33 --output "VIDEO.MP4" "process.avs"

To generate AAC I use ffmpeg:

ffmpeg -vn -y -i process.avs -acodec aac -vol 586 -ac 2 -ar 44100 -ab 192k AUDIO.M4A

To mux then together I use mkvmerge (http://www.bunkus.org/videotools/mkvtoolnix/), I did use ffmpeg also:

ffmpeg.exe -i VIDEO.MP4 -r 23.97 -vcodec copy -i AUDIO.M4A -acodec copy "READY.MP4"

I've done some tests with ffmpeg converting videos to MP4 and Xvid (x264 gives the best quality x size by the way) and so far no problems, this happens only with 23.97 videos, 29.97 ones are OK. I still have the muxed video that had this problem, do I need to upload it some where for debug or something?

I've asked first for youtube support but they told me that is something wrong with the encoder that I'm using, since this happens only 1173 and 1181 I thought that the developers should know about this.

Thank you.

wuemura
19th July 2009, 07:26
I've done a few tests, and in every video that has problems with youtube there is a difference in time between the VIDEO and AUDIO file.

This video trigger the problem:
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Muxing mode : Container profile=Unknown@3.0
Codec ID : V_MPEG4/ISO/AVC
Duration : 9mn 49s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 16/9
Frame rate : 23.976 fps
Standard : NTSC
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Writing library : x264 core 68 r1183 f21daff

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : A_AAC
Duration : 9mn 50s
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 44.1 KHz
Resolution : 16 bits

This one does not:

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Muxing mode : Container profile=Unknown@3.0
Codec ID : V_MPEG4/ISO/AVC
Duration : 5mn 43s
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 16/9
Frame rate : 29.970 fps
Standard : NTSC
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Writing library : x264 core 68 r1183 f21daff

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Format settings, SBR : No
Codec ID : A_AAC
Duration : 5mn 43s
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 44.1 KHz
Resolution : 16 bits

The raw material has 9mn 50s and not 9mn 49s, looks like x264 misses 1s encoding 23.97 material.