Transcoding to multiple image size

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Transcoding to multiple image size

Dmitriy Novash
Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Yi-Lung Tsai
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Dmitriy Novash

Hi, Bruce.

Problem with combine video and audio.
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111
0:00:00.015467297  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error
0:00:00.015490467  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error

Simplify code:
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! fakesink
Установка конвейера в состояние PAUSED…
Конвейер работает и не требует состояния PREROLL…
Установка конвейера в состояние PLAYING…
New clock: GstSystemClock


20.04.2017 18:58, Bruce Tsai пишет:
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Yi-Lung Tsai
I made a mistake when connecting “mpegtsmux” to “rtpmp2tpay”.

Here is modified version:

gat-launch-1.0 uridecodebin name=dec uri=<a href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 2:32 PM, Dmitriy Novash <[hidden email]> wrote:

Hi, Bruce.

Problem with combine video and audio.
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111
0:00:00.015467297  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error
0:00:00.015490467  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error

Simplify code:
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! fakesink
Установка конвейера в состояние PAUSED…
Конвейер работает и не требует состояния PREROLL…
Установка конвейера в состояние PLAYING…
New clock: GstSystemClock


20.04.2017 18:58, Bruce Tsai пишет:
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Dmitriy Novash

Hi.
First, problem with synchronization video and audio.
Second, with videoscale i get:
gstbin.c(2586): gst_bin_do_latency_func (): /GstPipeline:pipeline0:
Impossible to configure latency: max 0:00:02.700000000 < min 0:00:02.820000000. Add queues or other buffering elements.

Without videoscale 1 pair video+audio working, if I add second pair and adding videoscale after vt no errors, such a video and audio and if I remove videoscale and left other:
$ gst-launch-1.0 uridecodebin name=dec uri=udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videoscale method=0 ! videorate ! video/x-raw,width=360,height=288,framerate=25/1 ! queue ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1.
I get 2 working copies of video+audio witout scale and with audio+video synchronization problem.


21.04.2017 10:35, Bruce Tsai пишет:
I made a mistake when connecting “mpegtsmux” to “rtpmp2tpay”.

Here is modified version:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 2:32 PM, Dmitriy Novash <[hidden email]> wrote:

Hi, Bruce.

Problem with combine video and audio.
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111
0:00:00.015467297  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error
0:00:00.015490467  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error

Simplify code:
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! fakesink
Установка конвейера в состояние PAUSED…
Конвейер работает и не требует состояния PREROLL…
Установка конвейера в состояние PLAYING…
New clock: GstSystemClock


20.04.2017 18:58, Bruce Tsai пишет:
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Yi-Lung Tsai
Let’s write one pair of A/V to disk to see if A/V sync problem occurs.

gat-launch-1.0 uridecodebin name=dec uri=<a href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! filesink location=test.ts \
at. ! queue ! aacparse ! muxer. \

=====
Then check UDP output of one pair of A/V to see if A/V sync problem occurs.

gat-launch-1.0 uridecodebin name=dec uri=<a href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer.


--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 6:01 PM, Dmitriy Novash <[hidden email]> wrote:

Hi.
First, problem with synchronization video and audio.
Second, with videoscale i get:
gstbin.c(2586): gst_bin_do_latency_func (): /GstPipeline:pipeline0:
Impossible to configure latency: max 0:00:02.700000000 < min 0:00:02.820000000. Add queues or other buffering elements.

Without videoscale 1 pair video+audio working, if I add second pair and adding videoscale after vt no errors, such a video and audio and if I remove videoscale and left other:
$ gst-launch-1.0 uridecodebin name=dec uri=<a href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videoscale method=0 ! videorate ! video/x-raw,width=360,height=288,framerate=25/1 ! queue ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1.
I get 2 working copies of video+audio witout scale and with audio+video synchronization problem.


21.04.2017 10:35, Bruce Tsai пишет:
I made a mistake when connecting “mpegtsmux” to “rtpmp2tpay”.

Here is modified version:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 2:32 PM, Dmitriy Novash <[hidden email]> wrote:

Hi, Bruce.

Problem with combine video and audio.
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111
0:00:00.015467297  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error
0:00:00.015490467  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error

Simplify code:
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! fakesink
Установка конвейера в состояние PAUSED…
Конвейер работает и не требует состояния PREROLL…
Установка конвейера в состояние PLAYING…
New clock: GstSystemClock


20.04.2017 18:58, Bruce Tsai пишет:
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Dmitriy Novash
In reply to this post by Yi-Lung Tsai

Recorded video to disk is perfect, but real time output to udp have A/V sync problem.


21.04.2017 10:35, Bruce Tsai пишет:
I made a mistake when connecting “mpegtsmux” to “rtpmp2tpay”.

Here is modified version:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 2:32 PM, Dmitriy Novash <[hidden email]> wrote:

Hi, Bruce.

Problem with combine video and audio.
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111
0:00:00.015467297  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error
0:00:00.015490467  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error

Simplify code:
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! fakesink
Установка конвейера в состояние PAUSED…
Конвейер работает и не требует состояния PREROLL…
Установка конвейера в состояние PLAYING…
New clock: GstSystemClock


20.04.2017 18:58, Bruce Tsai пишет:
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Yi-Lung Tsai
This situation is weird to me.
I suppose A/V timestamp is fixed in “mpegtsmux” so “filesink” or “udpsink” shall output same result.
Maybe “rtpmp2tpay” changes the timestamp information?

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 8:16 PM, Dmitriy Novash <[hidden email]> wrote:

Recorded video to disk is perfect, but real time output to udp have A/V sync problem.


21.04.2017 10:35, Bruce Tsai пишет:
I made a mistake when connecting “mpegtsmux” to “rtpmp2tpay”.

Here is modified version:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 2:32 PM, Dmitriy Novash <[hidden email]> wrote:

Hi, Bruce.

Problem with combine video and audio.
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111
0:00:00.015467297  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error
0:00:00.015490467  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error

Simplify code:
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! fakesink
Установка конвейера в состояние PAUSED…
Конвейер работает и не требует состояния PREROLL…
Установка конвейера в состояние PLAYING…
New clock: GstSystemClock


20.04.2017 18:58, Bruce Tsai пишет:
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Dmitriy Novash

Maybe fixed in later releases.
A try to compile from sources, but have some troubles.

Can you suggest something else?
What i need to get working pipeline with videoscale?


22.04.2017 07:33, Bruce Tsai пишет:
This situation is weird to me.
I suppose A/V timestamp is fixed in “mpegtsmux” so “filesink” or “udpsink” shall output same result.
Maybe “rtpmp2tpay” changes the timestamp information?

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 8:16 PM, Dmitriy Novash <[hidden email]> wrote:

Recorded video to disk is perfect, but real time output to udp have A/V sync problem.


21.04.2017 10:35, Bruce Tsai пишет:
I made a mistake when connecting “mpegtsmux” to “rtpmp2tpay”.

Here is modified version:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 2:32 PM, Dmitriy Novash <[hidden email]> wrote:

Hi, Bruce.

Problem with combine video and audio.
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111
0:00:00.015467297  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error
0:00:00.015490467  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error

Simplify code:
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! fakesink
Установка конвейера в состояние PAUSED…
Конвейер работает и не требует состояния PREROLL…
Установка конвейера в состояние PLAYING…
New clock: GstSystemClock


20.04.2017 18:58, Bruce Tsai пишет:
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Yi-Lung Tsai
How about this:

gat-launch-1.0 uridecodebin name=dec uri=<a href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! queue ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! queue ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! queue ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! queue ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! queue ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! queue ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

I add one more “queue" between “h264parse” and “mpegtsmux”, and one more “queue” between “rtpmp2tpay” and “udpsink”.
First added “queue” is to make sure “x264enc” is not blocked by “mpegtsmux”.
Second added “queue” is to decouple “mpegtsmux” from “udpsink”.

--
Yi-Lung (Bruce) Tsai





On Apr 25, 2017, at 3:36 PM, Dmitriy Novash <[hidden email]> wrote:

Maybe fixed in later releases.
A try to compile from sources, but have some troubles.

Can you suggest something else?
What i need to get working pipeline with videoscale?


22.04.2017 07:33, Bruce Tsai пишет:
This situation is weird to me.
I suppose A/V timestamp is fixed in “mpegtsmux” so “filesink” or “udpsink” shall output same result.
Maybe “rtpmp2tpay” changes the timestamp information?

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 8:16 PM, Dmitriy Novash <[hidden email]> wrote:

Recorded video to disk is perfect, but real time output to udp have A/V sync problem.


21.04.2017 10:35, Bruce Tsai пишет:
I made a mistake when connecting “mpegtsmux” to “rtpmp2tpay”.

Here is modified version:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 2:32 PM, Dmitriy Novash <[hidden email]> wrote:

Hi, Bruce.

Problem with combine video and audio.
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111
0:00:00.015467297  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error
0:00:00.015490467  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error

Simplify code:
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! fakesink
Установка конвейера в состояние PAUSED…
Конвейер работает и не требует состояния PREROLL…
Установка конвейера в состояние PLAYING…
New clock: GstSystemClock


20.04.2017 18:58, Bruce Tsai пишет:
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Transcoding to multiple image size

Dmitriy Novash

./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstURIDecodeBin:dec:
failed delayed linking some pad of GstURIDecodeBin named dec to some pad of GstVideoConvert named videoconvert0


29.04.2017 17:41, Bruce Tsai пишет:
How about this:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! queue ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! queue ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! queue ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! queue ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! queue ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! queue ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

I add one more “queue" between “h264parse” and “mpegtsmux”, and one more “queue” between “rtpmp2tpay” and “udpsink”.
First added “queue” is to make sure “x264enc” is not blocked by “mpegtsmux”.
Second added “queue” is to decouple “mpegtsmux” from “udpsink”.

--
Yi-Lung (Bruce) Tsai





On Apr 25, 2017, at 3:36 PM, Dmitriy Novash <[hidden email]> wrote:

Maybe fixed in later releases.
A try to compile from sources, but have some troubles.

Can you suggest something else?
What i need to get working pipeline with videoscale?


22.04.2017 07:33, Bruce Tsai пишет:
This situation is weird to me.
I suppose A/V timestamp is fixed in “mpegtsmux” so “filesink” or “udpsink” shall output same result.
Maybe “rtpmp2tpay” changes the timestamp information?

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 8:16 PM, Dmitriy Novash <[hidden email]> wrote:

Recorded video to disk is perfect, but real time output to udp have A/V sync problem.


21.04.2017 10:35, Bruce Tsai пишет:
I made a mistake when connecting “mpegtsmux” to “rtpmp2tpay”.

Here is modified version:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
at. ! queue ! aacparse ! muxer. \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
at. ! queue ! aacparse ! muxer1. \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113 \
at. ! queue ! aacparse ! muxer2.

--
Yi-Lung (Bruce) Tsai





On Apr 21, 2017, at 2:32 PM, Dmitriy Novash <[hidden email]> wrote:

Hi, Bruce.

Problem with combine video and audio.
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111
0:00:00.015467297  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error
0:00:00.015490467  3955      0x1f2a980 ERROR           GST_PIPELINE grammar.y:959:priv_gst_parse_yyparse: syntax error

Simplify code:
$ GST_DEBUG=1 gst-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 dec. ! videoconvert ! deinterlace ! tee name=vt dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at vt. ! videoscale method=0 ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 at. ! fakesink
Установка конвейера в состояние PAUSED…
Конвейер работает и не требует состояния PREROLL…
Установка конвейера в состояние PLAYING…
New clock: GstSystemClock


20.04.2017 18:58, Bruce Tsai пишет:
First, there is no need to mix-use “decodebin” and “tsdemux”.
“decodebin” already has demux capability.
Second, there are too many “queue” in pipeline.
Each “queue” introduces a new thread.
Too many unnecessary threads is not a good idea.
Third, “tee” for audio stream is also necessary.
Each “mux” needs a copy of video and a copy of audio.
Use “tee” to get three copies of video and audio respectively.
Then combine each pair of video and audio to a “mpegtsmux”.

I tried to rewrite your pipeline as follows:

gat-launch-1.0 uridecodebin name=dec uri=<a moz-do-not-send="true" href="udp://239.50.50.50:1234" class="">udp://239.50.50.50:1234 \
dec. ! videoconvert ! deinterlace ! videoscale method=0 ! tee name=vt \
dec. ! audioconvert ! audioresample ! audio/x-raw,rate=48000,channels=1 ! audiorate ! queue ! voaacenc bitrate=32000 ! tee name=at \
vt. ! queue ! videorate ! video/x-raw,width=640,height=512,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
at. ! queue ! aacparse ! muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
vt. ! queue ! videorate ! video/x-raw,width=320,height=256,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 \
at. ! queue ! aacparse ! muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
vt. ! queue ! videorate ! video/x-raw,width=160,height=128,framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 \
at. ! queue ! aacparse ! muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113

I didn’t verify above pipeline on my machine.
You could try it with first pair of output only.
Simplicity is good for debug.
Then you could add second pair and then third pair.


--
Yi-Lung (Bruce) Tsai





On Apr 20, 2017, at 9:49 PM, Dmitriy Novash <[hidden email]> wrote:

Hi all.

I have many TV streams (Mpeg2) in udp multicast.
I want to have stream in H264+AAC in udp multicast with 3 resolutions: 1:1 (original),1:2,1:4. Now I do it with 3 processes of gst-launch, but for optimization of CPU usage I think I can do it in one process.
After several tries I get 3 videos with 3 resolutions, but i can't get audio for all threads, only for one.
I'm using gstreamer 1.00+ version:
$ gst-launch-1.0 --version
gst-launch-1.0 version 1.8.3
GStreamer 1.8.3

My configuration:
gst-launch-1.0 udpsrc uri=udp://239.50.50.50:1234 ! queue ! tsparse ! queue ! tsdemux name=demux \
demux. ! queue ! mpegvideoparse ! queue ! decodebin ! queue ! deinterlace ! \
tee name=tee1 ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=640, height=512, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer alignment=7 \
demux. ! queue !  decodebin ! queue ! audioconvert ! audioresample ! queue ! audio/x-raw, rate=48000, channels=1 ! audiorate ! voaacenc bitrate=32000 ! queue ! aacparse ! queue ! tee name=tee2 ! queue ! muxer. \
muxer. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1111 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=320, height=256, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer1 alignment=7 muxer1. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1112 \
tee1. ! queue ! videoscale method=0 ! videorate ! video/x-raw, width=160, height=128, framerate=25/1 ! x264enc ! h264parse ! mpegtsmux name=muxer2 alignment=7 muxer2. ! rtpmp2tpay ! udpsink host=127.0.0.1 port=1113


I can't join mpedtsmux and tee.

So I want to decode video, get 3 copies, each copy scale to some resolution, encode, decode + encode audio and join to each copy of video, output each copy in udp unicast to some port.

Help, maybe someone have working solution for my task.
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua
_______________________________________________
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

-- 
BR, Dmitriy Novash
Wnet IPTV/Media team
tel: +380(44) 5-900-800 (доп. 1132)
http://wnet.ua

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Loading...