This post was updated on .
Hi,I'm using RPi2 with Raspbian. I'm trying to find best solution for transcoding .ts files from tvheadend. At the moment the best is using Gstreamer because I can handle best performace. With Gssreamer I can transcode 1 minute .ts FHD video file to .mkv 480x270 in 30 secons which is in my opinion very good performance and I want to keep it.But I have problem with Gstreamer to make conversion .ts to mkv (or .mp4) with audio. Importand is that I have to have output video resized. Here is example which is working but no audio:
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 Here is another example which working, this time with with audio, but I can't resize video by changing omxh264enc parameters from example above: 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 ! omxh264enc ! "video/x-h264,profile=high" ! h264parse ! mux. Anyone has some command for gst-launch-1.0 to nice converting .ts to mkv (or mp4) with audio working? _______________________________________________ gstreamer-devel mailing list gstreamer-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
link the matroskamux to
filesink and link the h264parse to .stream Von: gstreamer-devel
[mailto:[hidden email]] Im Auftrag von Kazuko Nakamura Hi, I'm using RPi2 with Raspbian. I'm trying to find best solution for
transcoding .ts files from tvheadend. At the moment the best is using Gstreamer
because I can handle best performace. With Gssreamer I can transcode 1 minute
.ts FHD video file to .mkv 480x270 in 30 secons which is in my opinion very
good performance and I want to keep it. But I have problem with Gstreamer to make conversion .ts to mkv (or
.mp4) with audio. Importand is that I have to have output video resized. Here is example which is working but no audio: [code]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[/code] Here is another example which working, this time with with audio, but I
can't resize video by changing omxh264enc parameters from example above: [code]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 !
omxh264enc ! "video/x-h264,profile=high" ! h264parse ! mux.[/code] Anyone has some command for gst-launch-1.0 to nice converting .ts to
mkv (or mp4) with audio working? _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thanks for advice!
From this example: 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 If I change to *h264parse stream.* I have just audio with no video in 1.mkv file. I don't know how to link the matroskamux to filesink -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
See example:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/h tml/gst-plugins-good-plugins-matroskamux.html -----Ursprüngliche Nachricht----- Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von fufu5000 Gesendet: Dienstag, 17. Oktober 2017 11:45 An: [hidden email] Betreff: Re: AW: gstreamer - how to convert .ts to .mkv or .mp4 with sound Thanks for advice! From this example: 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,fra merate=25/1 ! *h264parse* ! filesink location=1.mkv If I change to *h264parse stream.* I have just audio with no video in 1.mkv file. I don't know how to link the matroskamux to filesink -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
So far no success.
I was trying to do that: gst-launch-1.0 -v filesrc location=1.ts ! tsdemux parse-private-sections=false name=demux ! queue ! ac3parse ! matroskamux name=stream demux. ! filesink location=1.mkv 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 ! stream. but doesn't work. -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
If I make that command:
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 \ ! omxh264enc \ ! "video/x-h264,profile=high" \ ! h264parse \ ! mux. Working, but I can't resize video. For example if I change to: ! "video/x-h264,stream-format=byte-stream,profile=high,width=480,height=270,framerate=25/1" Gstreamer stops and 1.mkv has 0kb -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Perhaps you should include a videoscale in your pipeline to resize the
image. On 17/10/2017 22:41, fufu5000 wrote: > If I make that command: > > 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 \ > ! omxh264enc \ > ! "video/x-h264,profile=high" \ > ! h264parse \ > ! mux. > > Working, but I can't resize video. For example if I change to: > > ! > "video/x-h264,stream-format=byte-stream,profile=high,width=480,height=270,framerate=25/1" > > Gstreamer stops and 1.mkv has 0kb > _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
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. -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
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. > _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by fufu5000
i use Avdshare Video Converter to convert ts to mkv or mp4 with audio. you
can try it out. -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by BGraaf
iDealshare VideoGo also works great to convert between TS, MKV, MP4, AVI,
MOV, WMV, etc with high video and audio quality. -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |