Question about 3gpp and appsrc usage.

Arun Raghavan arun at arunraghavan.net
Wed May 18 04:02:57 UTC 2016


On Tue, 17 May 2016, at 11:54 AM, Jabra Havridi wrote:
> Hi, gstreamer community!
> 
> Sorry for my language skill in advance.
> 
> I have a task: capture sound on android tablet, encode it with amr-nb
> codec, and save it to 3pg-file.
> 
> I decided to capture sound and encode it with MediaCodec from Android
> API.
> Then i push it to gstreamer pipeline, that is responsible for recording
> 3gp-files from such stream.

Out of curiosity, have you considered running the entire pipeline via
GStreamer instead? You could then just use openslesssrc ! amrnbenc !
3gppmux ! filesink.

> I'm already done capture and encoding parts. Now my task is: push amr-nb
> stream to gstreamer pipeline through appsrc.
> 
> I use this pipeline to produce 3gp-files (this is equivalent for my
> code):
> appsrc caps="audio/AMR,rate=8000,channels=1"
> stream-type=GST_APP_STREAM_TYPE_STREAM format=GST_FORMAT_TIME
> is-live=TRUE
> min-latency=0 do-timestamp=TRUE ! queue ! 3gppmux ! filesink
> location="/mnt/sdcard/temp/recording.3gp".
> 
> Now i'm struggling with such a problem: resulting 3gp-file is wrong. This
> appears as playback problems:
> 1) Timeline is not functional(current position on timeline stays at the
> begining all the playback time).
> 2) Some players can't play this files at all(VLC).
> 3) Recorded sound includes artefacts like a jitter.
> 
> To get deeper into the problem, i try to play my file and independent
> amr-nb-3gp-file without such problems(from
> http://download.wavetlan.com/SVV/Media/HTTP/http-3gp-audio.htm)
> with enhanced logging pipeline:
> 
> my file:
> gst-launch-1.0.exe -ve --gst-debug=*:3,qtdemux:5 filesrc
> location="c:/temp/1461580323909-1461580384071.3gp" ! queue ! qtdemux !
> amrnbdec ! directsoundsink 2>20160428_002_recorded_on_tablet_amr_3gp.log
> 
> Playback log for my file(also i have attached it to the letter):
> http://pastebin.com/JXxZzH5C
> 
> 
> independent normal amr-3gp:
> gst-launch-1.0.exe -ve --gst-debug=*:3,qtdemux:5 filesrc
> location="c:/temp/test1_AMR-NB_Mono_7.95kbps_8000Hz.3GP" ! queue !
> qtdemux
> ! amrnbdec ! directsoundsink 2>20160428_001_normal_amr_3gp_from_web.log
> 
> Playback log for normal amr-3gp: http://pastebin.com/2bMzJJqC
> 
> 
> Same problems appears while trying to stick together many amr buffers in
> different files using multifilesrc & 3gppmux:
> 
> gst-launch-1.0.exe -ve --gst-debug=*:3,qtdemux:5 filesrc
> location="c:/temp/touput_01.3gp" ! queue ! qtdemux ! amrnbdec !
> directsoundsink 2>20160428_003_assembled_from_buffers_amr_3gp.log
> 
> Playback log for this case: http://pastebin.com/8q3vSrie
> 
> 
> There is my questions:
>  Is there any pitfalls with appsrc and 3gppmux usage within such a
>  pipeline?
>  Is there any tricks with 3gppmux and a pipeline timing?
> 
> Any useful advices will be greatly appreciated.

To start with, you might want to see what timestamps your buffers are
getting, since you're effectively adding timestamps yourself with appsrc
after capture and encode (and thus they might not be smooth).

-- Arun


More information about the gstreamer-devel mailing list