pinkshiro
15th January 2011, 04:31
Hi all,
I'm having weird issues with a specific mp3 file, which when I use with AVS and FFmpeg, I cannot get an outputted movie with sound integrated! If I pass the mp3 through ffmpeg, even if I don't change any options, it becomes usable. This seems bizarre. With the information below, is anyone able to help me solve why this mp3 is misbehaving? Any help would be appreciated.
First, a screenshot of the G Spot output for the mp3 file:
http://www.flipsidedesign.co.nz/images/gspot-ss.jpg
The AVS Script:
Import("../kenburnseffect.avs")
loadplugin("../ffms2.dll")
Img1=ImageSource("img-1.jpg", end = 372, use_DevIl=false)
Img2=ImageSource("img-2.jpg", end = 312, use_DevIl=false)
Img3=ImageSource("img-3.jpg", end = 312, use_DevIl=false)
Img1=Img1.Crop((Width(Img1)-640)/2, (Height(Img1)-360)/2, 640, 360).ConvertToRGB32()
Img2=Img2.Crop((Width(Img2)-640)/2, (Height(Img2)-360)/2, 640, 360).ConvertToRGB32()
Img3=Img3.Crop((Width(Img3)-640)/2, (Height(Img3)-360)/2, 640, 360).ConvertToRGB32()
Img1=Img1.KenBurnsEffect(startFrame=0, endFrame=372, KeepState=false, startZoomFactor=125, endZoomFactor=125, startPanX=-40, endPanX=40)
Img2=Img2.KenBurnsEffect(startFrame=0, endFrame=312, KeepState=false, startZoomFactor=100, endZoomFactor=125)
Img3=Img3.KenBurnsEffect(startFrame=0, endFrame=312, KeepState=false, startZoomFactor=125, endZoomFactor=125, startPanY=-22.5, endPanY=22.5)
FinalVideo = Dissolve(Img1, Img2, Img3, 12)
Voiceover=FFAudioSource("sculpture.mp3", cache = false)
Voiceover = ConvertToMono(Voiceover)
CombinedAudio = Normalize(Voiceover, 0.75)
CombinedAudio = FadeOut0(CombinedAudio, 24)
FinalVideo = AudioDub(FinalVideo, CombinedAudio)
flipvertical(FinalVideo)
The Ffmpeg command:
ffmpeg.exe -i "manics/manics.avs" -crf
15.0 -vcodec libx264 -acodec libfaac -ab 192k -coder 1 -flags +loop -cmp +chroma
-partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_ran
ge 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 2 -qcom
p 0.6 -qdiff 4 -bf 4 -refs 4 -directpred 3 -threads 0 -s 640x360 -y "manics.mp4"
The Ffmpeg output:
FFmpeg version SVN-r18709, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --prefix=/mingw --cross-prefix=i686-ming
w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686 --cpu=i686 --e
nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm --enabl
e-libfaac --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheo
ra --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid -
-enable-libschroedinger --enable-libx264
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.27. 0 / 52.27. 0
libavformat 52.32. 0 / 52.32. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on Apr 28 2009 04:04:42, gcc: 4.2.4
Seems stream 0 codec frame rate differs from container frame rate: 24.00 (24/1)
-> 24.00 (25165824/1048576)
Input #0, avs, from 'manics/manics.avs':
Duration: 00:00:40.62, start: 0.000000, bitrate: 0 kb/s
Stream #0.0: Video: rawvideo, bgra, 640x360, 176947 kb/s, 24 tbr, 24 tbn, 24
tbc
Stream #0.1: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
[libx264 @ 0x2dbff10]width or height not divisible by 16 (640x360), compression
will suffer.
[libx264 @ 0x2dbff10]using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x2dbff10]profile Main, level 3.0
Output #0, mp4, to 'manics.mp4':
Stream #0.0: Video: libx264, yuv420p, 640x360, q=2-31, 200 kb/s, 25165824.00
tbn, 24 tbc
Stream #0.1: Audio: libfaac, 44100 Hz, mono, s16, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 26 fps= 0 q=-1.0 Lsize= 137kB time=0.93 bitrate=1210.2kbits/s
video:135kB audio:0kB global headers:1kB muxing overhead 0.994789%
[libx264 @ 0x2dbff10]slice I:1 Avg QP:12.99 size: 57381
[libx264 @ 0x2dbff10]slice P:12 Avg QP:15.54 size: 4906
[libx264 @ 0x2dbff10]slice B:13 Avg QP:17.03 size: 1695
[libx264 @ 0x2dbff10]consecutive B-frames: 8.0% 72.0% 0.0% 0.0% 20.0%
[libx264 @ 0x2dbff10]mb I I16..4: 3.6% 0.0% 96.4%
[libx264 @ 0x2dbff10]mb P I16..4: 0.0% 0.0% 0.0% P16..4: 73.8% 4.7% 10.5%
0.0% 0.0% skip:11.0%
[libx264 @ 0x2dbff10]mb B I16..4: 0.0% 0.0% 0.0% B16..8: 28.5% 0.8% 0.7%
direct:21.8% skip:48.1% L0:63.0% L1:26.6% BI:10.4%
[libx264 @ 0x2dbff10]direct mvs spatial:84.6% temporal:15.4%
[libx264 @ 0x2dbff10]ref P L0 27.1% 21.7% 37.7% 13.5%
[libx264 @ 0x2dbff10]ref B L0 37.0% 26.1% 36.9%
[libx264 @ 0x2dbff10]SSIM Mean Y:0.9956108
[libx264 @ 0x2dbff10]kb/s:1021.2
At This Point, a 1 second video is outputted with no audio....(should be closer to 40 seconds wtf)
So I run the following command in Ffmpeg:
ffmpeg -i manics/sculpture.mp3 -ab 192k manics/voiceover.mp3
Which should do nothing as the file is already 192k. So, with the new file comes a new Gspot screenshot:
http://www.flipsidedesign.co.nz/images/gspot-ss1.jpg
After changing the avs to load in the new audio file, I execute the same ffmpeg command as above. I get this output
FFmpeg version SVN-r18709, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --prefix=/mingw --cross-prefix=i686-ming
w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686 --cpu=i686 --e
nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm --enabl
e-libfaac --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheo
ra --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid -
-enable-libschroedinger --enable-libx264
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.27. 0 / 52.27. 0
libavformat 52.32. 0 / 52.32. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on Apr 28 2009 04:04:42, gcc: 4.2.4
Seems stream 0 codec frame rate differs from container frame rate: 24.00 (24/1)
-> 24.00 (25165824/1048576)
Input #0, avs, from 'manics/manics.avs':
Duration: 00:00:40.62, start: 0.000000, bitrate: 0 kb/s
Stream #0.0: Video: rawvideo, bgra, 640x360, 176947 kb/s, 24 tbr, 24 tbn, 24
tbc
Stream #0.1: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
[libx264 @ 0x2daff10]width or height not divisible by 16 (640x360), compression
will suffer.
[libx264 @ 0x2daff10]using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x2daff10]profile Main, level 3.0
Output #0, mp4, to 'manics.mp4':
Stream #0.0: Video: libx264, yuv420p, 640x360, q=2-31, 200 kb/s, 25165824.00
tbn, 24 tbc
Stream #0.1: Audio: libfaac, 44100 Hz, mono, s16, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 975 fps= 34 q=-1.0 Lsize= 3640kB time=40.54 bitrate= 735.6kbits/s
video:3237kB audio:376kB global headers:1kB muxing overhead 0.752564%
[libx264 @ 0x2daff10]slice I:4 Avg QP:11.49 size: 47372
[libx264 @ 0x2daff10]slice P:343 Avg QP:13.57 size: 5991
[libx264 @ 0x2daff10]slice B:628 Avg QP:15.67 size: 1704
[libx264 @ 0x2daff10]consecutive B-frames: 1.0% 33.0% 30.6% 10.7% 24.7%
[libx264 @ 0x2daff10]mb I I16..4: 15.7% 0.0% 84.3%
[libx264 @ 0x2daff10]mb P I16..4: 0.5% 0.0% 2.4% P16..4: 70.0% 5.1% 10.0%
0.0% 0.0% skip:12.1%
[libx264 @ 0x2daff10]mb B I16..4: 0.1% 0.0% 0.0% B16..8: 26.4% 1.0% 1.0%
direct:21.8% skip:49.7% L0:60.0% L1:28.0% BI:12.0%
[libx264 @ 0x2daff10]direct mvs spatial:99.7% temporal:0.3%
[libx264 @ 0x2daff10]ref P L0 30.0% 27.7% 24.8% 17.5%
[libx264 @ 0x2daff10]ref B L0 42.2% 24.9% 32.9%
[libx264 @ 0x2daff10]SSIM Mean Y:0.9959011
[libx264 @ 0x2daff10]kb/s:652.6
Surprise surprise, the correct video is being outputted at 40 secs with audio.
What gives? I don't want to process this mp3 first (pointlessly) before it's workable, and I am afraid of coming across other audio files which cause similar problems. Can anyone see where I am going wrong?
I'm having weird issues with a specific mp3 file, which when I use with AVS and FFmpeg, I cannot get an outputted movie with sound integrated! If I pass the mp3 through ffmpeg, even if I don't change any options, it becomes usable. This seems bizarre. With the information below, is anyone able to help me solve why this mp3 is misbehaving? Any help would be appreciated.
First, a screenshot of the G Spot output for the mp3 file:
http://www.flipsidedesign.co.nz/images/gspot-ss.jpg
The AVS Script:
Import("../kenburnseffect.avs")
loadplugin("../ffms2.dll")
Img1=ImageSource("img-1.jpg", end = 372, use_DevIl=false)
Img2=ImageSource("img-2.jpg", end = 312, use_DevIl=false)
Img3=ImageSource("img-3.jpg", end = 312, use_DevIl=false)
Img1=Img1.Crop((Width(Img1)-640)/2, (Height(Img1)-360)/2, 640, 360).ConvertToRGB32()
Img2=Img2.Crop((Width(Img2)-640)/2, (Height(Img2)-360)/2, 640, 360).ConvertToRGB32()
Img3=Img3.Crop((Width(Img3)-640)/2, (Height(Img3)-360)/2, 640, 360).ConvertToRGB32()
Img1=Img1.KenBurnsEffect(startFrame=0, endFrame=372, KeepState=false, startZoomFactor=125, endZoomFactor=125, startPanX=-40, endPanX=40)
Img2=Img2.KenBurnsEffect(startFrame=0, endFrame=312, KeepState=false, startZoomFactor=100, endZoomFactor=125)
Img3=Img3.KenBurnsEffect(startFrame=0, endFrame=312, KeepState=false, startZoomFactor=125, endZoomFactor=125, startPanY=-22.5, endPanY=22.5)
FinalVideo = Dissolve(Img1, Img2, Img3, 12)
Voiceover=FFAudioSource("sculpture.mp3", cache = false)
Voiceover = ConvertToMono(Voiceover)
CombinedAudio = Normalize(Voiceover, 0.75)
CombinedAudio = FadeOut0(CombinedAudio, 24)
FinalVideo = AudioDub(FinalVideo, CombinedAudio)
flipvertical(FinalVideo)
The Ffmpeg command:
ffmpeg.exe -i "manics/manics.avs" -crf
15.0 -vcodec libx264 -acodec libfaac -ab 192k -coder 1 -flags +loop -cmp +chroma
-partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_ran
ge 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 2 -qcom
p 0.6 -qdiff 4 -bf 4 -refs 4 -directpred 3 -threads 0 -s 640x360 -y "manics.mp4"
The Ffmpeg output:
FFmpeg version SVN-r18709, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --prefix=/mingw --cross-prefix=i686-ming
w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686 --cpu=i686 --e
nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm --enabl
e-libfaac --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheo
ra --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid -
-enable-libschroedinger --enable-libx264
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.27. 0 / 52.27. 0
libavformat 52.32. 0 / 52.32. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on Apr 28 2009 04:04:42, gcc: 4.2.4
Seems stream 0 codec frame rate differs from container frame rate: 24.00 (24/1)
-> 24.00 (25165824/1048576)
Input #0, avs, from 'manics/manics.avs':
Duration: 00:00:40.62, start: 0.000000, bitrate: 0 kb/s
Stream #0.0: Video: rawvideo, bgra, 640x360, 176947 kb/s, 24 tbr, 24 tbn, 24
tbc
Stream #0.1: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
[libx264 @ 0x2dbff10]width or height not divisible by 16 (640x360), compression
will suffer.
[libx264 @ 0x2dbff10]using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x2dbff10]profile Main, level 3.0
Output #0, mp4, to 'manics.mp4':
Stream #0.0: Video: libx264, yuv420p, 640x360, q=2-31, 200 kb/s, 25165824.00
tbn, 24 tbc
Stream #0.1: Audio: libfaac, 44100 Hz, mono, s16, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 26 fps= 0 q=-1.0 Lsize= 137kB time=0.93 bitrate=1210.2kbits/s
video:135kB audio:0kB global headers:1kB muxing overhead 0.994789%
[libx264 @ 0x2dbff10]slice I:1 Avg QP:12.99 size: 57381
[libx264 @ 0x2dbff10]slice P:12 Avg QP:15.54 size: 4906
[libx264 @ 0x2dbff10]slice B:13 Avg QP:17.03 size: 1695
[libx264 @ 0x2dbff10]consecutive B-frames: 8.0% 72.0% 0.0% 0.0% 20.0%
[libx264 @ 0x2dbff10]mb I I16..4: 3.6% 0.0% 96.4%
[libx264 @ 0x2dbff10]mb P I16..4: 0.0% 0.0% 0.0% P16..4: 73.8% 4.7% 10.5%
0.0% 0.0% skip:11.0%
[libx264 @ 0x2dbff10]mb B I16..4: 0.0% 0.0% 0.0% B16..8: 28.5% 0.8% 0.7%
direct:21.8% skip:48.1% L0:63.0% L1:26.6% BI:10.4%
[libx264 @ 0x2dbff10]direct mvs spatial:84.6% temporal:15.4%
[libx264 @ 0x2dbff10]ref P L0 27.1% 21.7% 37.7% 13.5%
[libx264 @ 0x2dbff10]ref B L0 37.0% 26.1% 36.9%
[libx264 @ 0x2dbff10]SSIM Mean Y:0.9956108
[libx264 @ 0x2dbff10]kb/s:1021.2
At This Point, a 1 second video is outputted with no audio....(should be closer to 40 seconds wtf)
So I run the following command in Ffmpeg:
ffmpeg -i manics/sculpture.mp3 -ab 192k manics/voiceover.mp3
Which should do nothing as the file is already 192k. So, with the new file comes a new Gspot screenshot:
http://www.flipsidedesign.co.nz/images/gspot-ss1.jpg
After changing the avs to load in the new audio file, I execute the same ffmpeg command as above. I get this output
FFmpeg version SVN-r18709, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --enable-memalign-hack --prefix=/mingw --cross-prefix=i686-ming
w32- --cc=ccache-i686-mingw32-gcc --target-os=mingw32 --arch=i686 --cpu=i686 --e
nable-avisynth --enable-gpl --enable-zlib --enable-bzlib --enable-libgsm --enabl
e-libfaac --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheo
ra --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid -
-enable-libschroedinger --enable-libx264
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.27. 0 / 52.27. 0
libavformat 52.32. 0 / 52.32. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on Apr 28 2009 04:04:42, gcc: 4.2.4
Seems stream 0 codec frame rate differs from container frame rate: 24.00 (24/1)
-> 24.00 (25165824/1048576)
Input #0, avs, from 'manics/manics.avs':
Duration: 00:00:40.62, start: 0.000000, bitrate: 0 kb/s
Stream #0.0: Video: rawvideo, bgra, 640x360, 176947 kb/s, 24 tbr, 24 tbn, 24
tbc
Stream #0.1: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
[libx264 @ 0x2daff10]width or height not divisible by 16 (640x360), compression
will suffer.
[libx264 @ 0x2daff10]using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[libx264 @ 0x2daff10]profile Main, level 3.0
Output #0, mp4, to 'manics.mp4':
Stream #0.0: Video: libx264, yuv420p, 640x360, q=2-31, 200 kb/s, 25165824.00
tbn, 24 tbc
Stream #0.1: Audio: libfaac, 44100 Hz, mono, s16, 192 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding
frame= 975 fps= 34 q=-1.0 Lsize= 3640kB time=40.54 bitrate= 735.6kbits/s
video:3237kB audio:376kB global headers:1kB muxing overhead 0.752564%
[libx264 @ 0x2daff10]slice I:4 Avg QP:11.49 size: 47372
[libx264 @ 0x2daff10]slice P:343 Avg QP:13.57 size: 5991
[libx264 @ 0x2daff10]slice B:628 Avg QP:15.67 size: 1704
[libx264 @ 0x2daff10]consecutive B-frames: 1.0% 33.0% 30.6% 10.7% 24.7%
[libx264 @ 0x2daff10]mb I I16..4: 15.7% 0.0% 84.3%
[libx264 @ 0x2daff10]mb P I16..4: 0.5% 0.0% 2.4% P16..4: 70.0% 5.1% 10.0%
0.0% 0.0% skip:12.1%
[libx264 @ 0x2daff10]mb B I16..4: 0.1% 0.0% 0.0% B16..8: 26.4% 1.0% 1.0%
direct:21.8% skip:49.7% L0:60.0% L1:28.0% BI:12.0%
[libx264 @ 0x2daff10]direct mvs spatial:99.7% temporal:0.3%
[libx264 @ 0x2daff10]ref P L0 30.0% 27.7% 24.8% 17.5%
[libx264 @ 0x2daff10]ref B L0 42.2% 24.9% 32.9%
[libx264 @ 0x2daff10]SSIM Mean Y:0.9959011
[libx264 @ 0x2daff10]kb/s:652.6
Surprise surprise, the correct video is being outputted at 40 secs with audio.
What gives? I don't want to process this mp3 first (pointlessly) before it's workable, and I am afraid of coming across other audio files which cause similar problems. Can anyone see where I am going wrong?