AW: AW: gstreamer - how to convert .ts to .mkv or .mp4 with sound

Ian Davidson id012c3076 at blueyonder.co.uk
Wed Oct 18 13:58:25 UTC 2017


I suspect that the CPU is going flat out.  It is just possible that you 
could do the scale before the convert and that it would make a 
difference - but the problem is that each frame needs to be resized and 
that takes a lot of CPU power.


On 18/10/2017 10:46, fufu5000 wrote:
> Thanks Ian,
>
> Is some progress :)
>
> This command is working:
>
> gst-launch-1.0 filesrc location=1.ts \
> ! decodebin name=demux demux. \
> ! queue \
> ! audioresample \
> ! "audio/x-raw,rate=44100" \
> ! audioconvert \
> ! "audio/x-raw,format=F32LE" \
> ! vorbisenc \
> ! mux. matroskamux name=mux \
> ! filesink location=1.mkv demux. \
> ! queue \
> ! videoconvert \
> ! videoscale \
> ! omxh264enc target-bitrate=1572864 control-rate=variable \
> !
> video/x-h264,stream-format=byte-stream,profile=high,width=480,height=270,framerate=25/1
> \
> ! h264parse \
> ! mux.
>
> Video is with changed bitrate and is scalled to 480x270
>
> But.... Now I have problem with performance on RPi2. If I take above
> command, transcoding 40 seconds .ts file takes about 4 minutes.
>
> If I take this command on the same .ts file:
>
> gst-launch-1.0 -v filesrc location=1.ts \
> ! tsdemux parse-private-sections=false name=demux \
> ! queue \
> ! ac3parse \
> ! matroskamux name=stream streamable=true demux. \
> ! queue \
> ! h264parse \
> ! omxh264dec \
> ! omxh264enc target-bitrate=1572864 control-rate=variable \
> !
> video/x-h264,stream-format=byte-stream,profile=high,width=480,height=270,framerate=25/1
> \
> ! h264parse \
> ! filesink location=1.mkv
>
> conversion takes just 20 seconds.
>



More information about the gstreamer-devel mailing list