[Asterisk-video] How to convert mp4save saved video

Borja SIXTO borja.sixto at i6net.com
Tue Oct 14 06:49:43 CDT 2008


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



More information about the asterisk-video mailing list