Merge Audio with Video and convert to 3gp format problem.

12 views
Skip to first unread message

kaimerachin

unread,
Mar 15, 2011, 4:26:46 AM3/15/11
to mediasoftpro
Hi,

Just purchased the Media Pro Handler, and tested out the code shown at
http://groups.google.com/group/mediasoftpro/browse_thread/thread/e5071a6095e691d4/4b7870ad8a0816f4?lnk=gst&q=attach+audio#4b7870ad8a0816f4,
but having got error.

The changes made are as following:

Changes are made on "_mhandler.CustomCommand" to return the results as
3gp format.

string original_video_path = _mhandler.InputPath + "\
\wearethechampion.3gp";
string audio_track_path = _mhandler.InputPath + "\
\wearethechampion.3gpp";
string final_video_path = _mhandler.InputPath + "\\sample.
3gp";
_mhandler.CustomCommand = " -i " + original_video_path + "
-i " +
audio_track_path + " -ab 128k -ar 22050 -f 3gp " +
final_video_path + "";
string result =_mhandler.Execute_FFMPEG();



Error shown as following:
FFmpeg version SVN-r25478, Copyright (c) 2000-2010 the FFmpeg
developers built on Oct 15 2010 04:07:09 with gcc 4.4.2 configuration:
--enable-gpl --enable-version3 --enable-libgsm --enable-pthreads --
enable-libvorbis --enable-libtheora --enable-libspeex --enable-
libmp3lame --enable-libopenjpeg --enable-libschroedinger --enable-
libopencore_amrwb --enable-libopencore_amrnb --enable-libvpx --
arch=x86 --enable-runtime-cpudetect --enable-libxvid --enable-libx264
--extra-libs='-lx264 -lpthread' --enable-librtmp --extra-libs='-lrtmp -
lpolarssl -lws2_32 -lwinmm' --target-os=mingw32 --enable-avisynth --
cross-prefix=i686-mingw32- --cc='ccache i686-mingw32-gcc' --enable-
memalign-hack libavutil 50.32. 3 / 50.32. 3 libavcore 0. 9. 1 / 0. 9.
1 libavcodec 52.92. 0 / 52.92. 0 libavformat 52.82. 0 / 52.82. 0
libavdevice 52. 2. 2 / 52. 2. 2 libavfilter 1.51. 1 / 1.51. 1
libswscale 0.12. 0 / 0.12. 0 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'C:\TestMux\contents\original\wearethechampion.3gp': Metadata:
major_brand : 3gp5 minor_version : 0 compatible_brands:
isom3gp53gp4mp41mp42 encoder : Yamb 2.1.0.0 [http://yamb.unite-
video.com] Duration: 00:03:02.06, start: 0.000000, bitrate: 264 kb/s
Stream #0.0(und): Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3],
132 kb/s, 15 fps, 15 tbr, 15k tbn, 15 tbc Stream #0.1(und): Audio:
aac, 44100 Hz, stereo, s16, 129 kb/s Input #1, mov,mp4,m4a,3gp,
3g2,mj2, from 'C:\TestMux\contents\original\wearethechampion.3gpp':
Metadata: major_brand : 3gp4 minor_version : 768 compatible_brands:
3gp43gp6 Duration: 00:00:36.22, start: 0.000000, bitrate: 17 kb/s
Stream #1.0(eng): Audio: amrnb, 8000 Hz, 1 channels, flt, 12 kb/s
[buffer @ 029e9fa0] w:320 h:240 pixfmt:yuv420p [h263 @ 003af4d0] The
specified picture size of 320x240 is not valid for the H.263 codec.
Valid sizes are 128x96, 176x144, 352x288, 704x576, and 1408x1152. Try
H.263+. Output #0, 3gp, to 'C:\TestMux\contents\original\sample.3gp':
Stream #0.0(und): Video: h263, yuv420p, 320x240 [PAR 1:1 DAR 4:3],
q=2-31, 200 kb/s, 90k tbn, 15 tbc Stream #0.1(und): Audio:
libopencore_amrnb, 22050 Hz, 1 channels, s16, 45 kb/s Stream mapping:
Stream #0.0 -> #0.0 Stream #0.1 -> #0.1 Error while opening encoder
for output stream #0.0 - maybe incorrect parameters such as bit_rate,
rate, width or height


Please help or guide me on what i should do,
Thanks in advance.

shane

unread,
Mar 28, 2011, 9:50:41 AM3/28/11
to mediasoftpro
Dear Customer,

U can achieve attaching audio with video file with final output as .
3gp video by using the following code.

We tested it on ffmpeg build shown below.

www.mediasoftpro.com/downloads/ffmpeg26122.zip

Sample Code:
*****************************************************************

_mhandler.InputPath = RootPath + "\\contents\\original";
_mhandler.OutputPath = RootPath + "\\contents\\flv";

string original_video_path = _mhandler.InputPath + "\\wubai.3gp";
string audio_track_path = _mhandler.InputPath + "\\wubai.3gpp";

string final_video_path = _mhandler.InputPath + "\\wubai_final..
3gp";
_mhandler.CustomCommand= " -i " + original_video_path + " -i " +
audio_track_path + " -s qcif -vcodec h263 -ac 1 -ar 8000 -r 25 -ab
12.2k -y " + final_video_path + "";
_mhandler.Execute_FFMPEG();

****************************************************************************
Check output and give us result.

Normal ffmpeg command will be looking like this
ffmpeg -i wubai.3gp -i wubai.3gpp -s qcif -vcodec h263 -ac 1 -ar 8000 -
r 25 -ab 12.2k -y wubai_final.3gp
Regards






On Mar 15, 1:26 pm, kaimerachin <kaimerac...@gmail.com> wrote:
> Hi,
>
> Just purchased the Media Pro Handler, and tested out the code shown athttp://groups.google.com/group/mediasoftpro/browse_thread/thread/e507...,
Reply all
Reply to author
Forward
0 new messages