How to use gstreamer to create an audio clip from a segment of a longer source?

I would like to use gstreamer to save an arbitrary clip from one audio file to a new file. For example, a segment from 1 minute to 2 minutes in the original. How to do it?

+3
source share
1 answer

You need gnonlin . See http://www.jonobacon.org/2006/12/27/using-gnonlin-with-gstreamer-and-python/

You will not need gnlcompositionit because you only need one segment. Use the parameter gnlfilesourcewith its beginning and duration set to 0, 1 minute, as well as with the launch of the medium and the duration of the media mode set to 1 minute, 1 minute. All times and durations in nanoseconds.

Take 5 seconds from source.mp3, starting at 10 seconds, write to destination.ogg:

gst-launch-0.10 gnlfilesource location=$PWD/source.mp3 \
start=0 duration=5000000000 media-start=10000000000 media-duration=5000000000 ! \
audioconvert ! vorbisenc ! oggmux ! filesink location=destination.ogg
+6
source

Source: https://habr.com/ru/post/1731737/


All Articles