Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Looking for a gstreamer pipeline for encoding multiple video stream variants for an mpegts feed #2

Open
Brainiarc7 opened this issue Oct 31, 2018 · 1 comment

Comments

@Brainiarc7
Copy link

Hello there,

Take this ffmpeg example which can encode an ingest (udp) to an mpegts feed with all audio & video variants muxed in:

/root/bin/ffmpeg -loglevel debug -threads 4 -filter_complex_threads 4 -fflags +genpts+nobuffer -i '$channel_udp_stream?fifo_size=9000000' -filter_complex \
"['$video_stream_id']split=3[s0][s1][s2]; \
 [s0]yadif[v0]; \
 [s1]yadif[v1]; \
 [s2]scale=w=1280:h=720:force_original_aspect_ratio=decrease:flags=lanczos,yadif[v2]" \
-bsf:a aac_adtstoasc \
-b:v:0 1500k -c:v h264_nvenc -a53cc 1 -preset slow -rc:v vbr_hq -pix_fmt yuv420p -profile:v main -level 4.0 -gpu 1 \
-b:v:1 1000k -c:v h264_nvenc -a53cc 1 -preset slow -rc:v vbr_hq -pix_fmt yuv420p -profile:v main -level 4.0 -gpu 2 \
-b:v:2 625k -c:v h264_nvenc -a53cc 1 -preset slow -rc:v vbr_hq -pix_fmt yuv420p -profile:v main -level 4.0 -gpu 3 \
-b:a:0 256k -b:a:1 192k -b:a:2 128k -c:a aac -ar 48000 \
-f mpegts \
"udp://$ip-address:$port"

The snippet above takes one ingest, uses a complex filter to create three variants that are encoded by the h264_nvenc encoder for video and three separate audio streams (already present in the input mpegts feed), and then muxes the result into an mpegts stream over udp.

How can I do something similar with gstreamer, using x264enc and faac elements, using the appropriate muxer?

@Brainiarc7
Copy link
Author

Hello,

Here's a rudimentary example, gleaned from documentation:

gst-launch-1.0 \
  udpsrc uri=udp://$ip_addr:$port ! decodebin3 ! tee name=t \
    t. ! queue ! x264enc bitrate=100000 ! mux. \
    t. ! queue ! x264enc bitrate=200000 ! mux. \
    t. ! queue ! x264enc bitrate=500000 ! mux. \
    t. ! queue ! faac bitrate=128000 ! mux. \
  qtmux name=mux ! udpsink host=$ip_addr port=$port 

Will test it shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant