[Asterisk-video] How to convert mp4save saved video
Silvio Sisto
sisto.silvio at gmail.com
Wed Oct 15 18:15:38 CDT 2008
Thanks for the fix.
I tried it and now ffmpeg seems to detect the stream correctly.
I get this error message though:
--------------------------------------
root at debian:~# *ffmpeg -i test.mp4 -f mpeg -acodec mp2 -ar 32000 test.mpeg
*
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
configuration: --enable-gpl --enable-pp --enable-pthreads --enable-vorbis
--enable-libogg --enable-a52 --enable-dts --enable-libgsm --enable-dc1394
--disable-debug --enable-shared --prefix=/usr
libavutil version: 0d.49.0.0
libavcodec version: 0d.51.11.0
libavformat version: 0d.50.5.0
built on Mar 26 2007 15:50:40, gcc: 4.1.2 20061115 (prerelease) (Debian
4.1.1-21)
Seems that stream 2 comes from film source: 1000.00 (90000/90) -> 10.00
(10/1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
Duration: 00:00:06.7, start: 0.000000, bitrate: 122 kb/s
Stream #0.0(eng): Audio: pcm_mulaw, 8000 Hz, mono, 64 kb/s
Stream #0.1(eng): Data: rtp / 0x20707472
Stream #0.2(eng): Video: h263, yuv420p, 176x144, 10.00 fps(r)
Stream #0.3(eng): Data: rtp / 0x20707472
File 'test.mpeg' already exists. Overwrite ? [y/N] y
Output #0, mpeg, to 'test.mpeg':
Stream #0.0: Video: mpeg1video, yuv420p, 176x144, q=2-31, 200 kb/s, 10.00
fps(c)
Stream #0.1: Audio: mp2, 32000 Hz, mono, 64 kb/s
Stream mapping:
Stream #0.2 -> #0.0
Stream #0.0 -> #0.1
[mpeg1video @ 0xb7e55f08]MPEG1/2 does not support 10/1 fps
*Error while opening codec for output stream #0.0 - maybe incorrect
parameters such as bit_rate, rate, width or height*
--------------------------------------
Even though the sound was too fast before, I used to get no error messages.
What can I try now?
Thanks, Best Regards,
Silvio Sisto
On Tue, Oct 14, 2008 at 9:49 AM, Borja SIXTO <borja.sixto at i6net.com> wrote:
> Hi Sergio,
>
> I have found a partial work around by adding some track information (for
> the alaw is the same) :
>
> /* Create audio track */
> audio = MP4AddAudioTrack(mp4, 8000, 0,
> MP4_ULAW_AUDIO_TYPE);
> MP4SetTrackIntegerProperty(mp4, audio,
> "mdia.minf.stbl.stsd.mp4a.channels", 1);
> MP4SetTrackIntegerProperty(mp4, audio,
> "mdia.minf.stbl.stsd.mp4a.sampleSize", 8);
> /* Create audio hint track */
> hintAudio = MP4AddHintTrack(mp4, audio);
> /* Set payload type for hint track */
> type = 0;
> audio_payload = 0;
> MP4SetHintTrackRtpPayload(mp4, hintAudio, "PCMU",
> &type, 0, NULL, 1, 0);
>
> But you need to set -acodec pcm_mulaw before the -i ffmpeg option.
>
> Just an other pending modification.
> We can add some informations in the recorded file like that (I am adding
> this modification) :
> #ifndef i6net
> MP4SetMetadataTool(mp4, "app_mp4");
> MP4SetMetadataWriter(mp4,"Called service");
> MP4SetMetadataArtist(mp4,"Caller");
> MP4SetMetadataAlbum(mp4,"Album");
> MP4SetMetadataName(mp4,"13/10 13h40");
> MP4SetMetadataYear(mp4,"2008");
> #endif
>
> Regards,
>
>
> Borja
>
>
> Sergio Garcia Murillo a écrit :
> > That's the problem:
> >
> > Stream #0.0(eng): Audio: pcm_mulaw, 8000 Hz, *_stereo, 128 kb/s_*
> >
> > I'll check if we set it wrong to stereo or it's ffmpeg the one that's
> > it's decoding it worng.
> >
> > BR
> > Sergio
> >
> > Silvio Sisto escribió:
> >> I was able to stream some video from x-lite to asterisk and save it
> >> using the mp4save application. Codecs used were g711 and h263.
> >> When I tried to convert the file to other formats using ffmpeg, the
> >> audio track had it's length reduced to a half. Sounds kinda like
> >> squirrels talking :)
> >> It seems that ffmpeg thinks the original file's audio track has 128
> >> kbps instead of 64 (as mp4info correctly recognizes it). I'm guessing
> >> ffmpeg doesn't support g711. Upon further investigation it seems that
> >> none of x-lite's codecs are supported by ffmpeg.
> >> Is there a way to make asterisk convert the audio stream to anther
> >> codec before mp4_save records it?
> >> Thanks,
> >> Silvio Sisto
> >>
> >> This is the content of the original (mp4save) file according to mp4info:
> >> ----------------------------------------------------------
> >> mp4info version 1.5.0.1 <http://1.5.0.1>
> >> test2.mp4:
> >> Track Type Info
> >> 1 audio G.711 uLaw, 11.120 secs, 64 kbps, 8000 Hz
> >> 2 hint Payload PCMU for track 1
> >> 3 video Unknown, 10.856 secs, 0 kbps, 0x0 @ 11.33 fps
> >> 4 hint Payload H263 for track 3
> >> mp4info: symbol lookup error: mp4info: undefined symbol:
> >> MP4GetMetadataGrouping
> >> ----------------------------------------------------------
> >>
> >> # ffmpeg -i test2.mp4 -f flv video2.flv
> >> OUTPUT:
> >> ----------------------------------------------------------
> >> FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
> >> configuration: --enable-gpl --enable-pp --enable-mp3lame
> >> --enable-faac --enable-faad --enable-amr_nb --enable-amr_wb
> >> --enable-shared
> >> libavutil version: 49.0.0
> >> libavcodec version: 51.11.0
> >> libavformat version: 50.5.0
> >> built on Oct 10 2008 16:54:46, gcc: 4.1.2 20061115 (prerelease)
> >> (Debian 4.1.1-21)
> >>
> >> Seems that stream 2 comes from film source: 1000.00 (90000/90) ->
> >> 19.00 (19/1)
> >> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test2.mp4':
> >> Duration: 00:00:11.1, start: 0.000000, bitrate: 92 kb/s
> >> Stream #0.0(eng): Audio: pcm_mulaw, 8000 Hz, stereo, 128 kb/s
> >> Stream #0.1(eng): Data: rtp / 0x20707472
> >> Stream #0.2(eng): Video: h263, yuv420p, 176x144, 19.00 fps(r)
> >> Stream #0.3(eng): Data: rtp / 0x20707472
> >> Output #0, flv, to 'video2.flv':
> >> Stream #0.0: Video: flv, yuv420p, 176x144, q=2-31, 200 kb/s, 19.00
> >> fps(c)
> >> Stream #0.1: Audio: mp3, 8000 Hz, stereo, 64 kb/s
> >> Stream mapping:
> >> Stream #0.2 -> #0.0
> >> Stream #0.0 -> #0.1
> >> Press [q] to stop encoding
> >> [h263 @ 0xb7e00468]warning: first frame is no keyframe
> >> [mp3 @ 0xb7e00468]lame: output buffer too small (buffer index: 321,
> >> free bytes: 1983)
> >> frame= 206 q=2.0 Lsize= 87kB time=5.4 bitrate= 131.4kbits/s
> >> video:30kB audio:42kB global headers:0kB muxing overhead 20.380929%
> >> ----------------------------------------------------------
> >>
> >> ------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> >>
> >> asterisk-video mailing list
> >> To UNSUBSCRIBE or update options visit:
> >> http://lists.digium.com/mailman/listinfo/asterisk-video
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > --Bandwidth and Colocation Provided by http://www.api-digital.com--
> >
> > asterisk-video mailing list
> > To UNSUBSCRIBE or update options visit:
> > http://lists.digium.com/mailman/listinfo/asterisk-video
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> asterisk-video mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-video
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-video/attachments/20081015/39af2d8d/attachment.htm
More information about the asterisk-video
mailing list