Skip to content

Instantly share code, notes, and snippets.

@cameronelliott
Forked from vr000m/gstreamer.cli
Created January 13, 2021 21:22
Show Gist options
  • Save cameronelliott/ddd32ba175280c0d8533e2c603fe7cfb to your computer and use it in GitHub Desktop.
Save cameronelliott/ddd32ba175280c0d8533e2c603fe7cfb to your computer and use it in GitHub Desktop.

Revisions

  1. @vr000m vr000m revised this gist Sep 3, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gstreamer.cli
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    YUV -> MP4
    gst-launch filesrc location=<YUV file name> ! videoparse height=144 width=176 framerate=15 ! x264enc name=encoder byte-stream=true bitrate=64 ! mp4mux ! filesink <mp4 file name>
    gst-launch filesrc location=<YUV file name> ! videoparse height=144 width=176 framerate=15 ! x264enc name=encoder byte-stream=true bitrate=64 ! mp4mux ! filesink location=<mp4 file name>

    gst-launch filesrc location=foreman15_600.yuv ! videoparse height=144 width=176 framerate=15 ! x264enc name=encoder byte-stream=true bitrate=64 ! rtph264pay name=packetiser ! fakesink

  2. @vr000m vr000m revised this gist Jun 15, 2011. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions gstreamer.cli
    Original file line number Diff line number Diff line change
    @@ -5,13 +5,15 @@ gst-launch filesrc location=foreman15_600.yuv ! videoparse height=144 width=176

    MP4 -> YUV
    gst-launch filesrc location=<MP4 file name> ! qtdemux ! ffdec_h264 ! videoparse height=144 width=176 framerate=15 ! filesink locatiion=<YUV file name>

    ----
    Stream MP4 file
    gst-launch filesrc location=IM2-YT-2_128k_20.mp4 ! qtdemux ! rtph264pay seqnum-offset=0 timestamp-offset=0 ssrc=0xaaaabbbb mtu=1450 perfect-rtptime=true ! udpsink clients=172.16.183.134:4400 -v
    gst-launch filesrc location=IM2-YT-2_128k_20.mp4 ! qtdemux ! rtph264pay seqnum-offset=0 timestamp-offset=0 ssrc=0xaaaabbbb mtu=1450 perfect-rtptime=true ! udpsink clients=172.16.183.134:4400

    gst-launch-0.10 udpsrc port=4400 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z2QAHqw05gLQ9v/ACAAGxAAAAwAEAAADAKA8WLZo\\,aOl4RLIs\", payload=(int)96, ssrc=(uint)2863315899, clock-base=(uint)0, seqnum-base=(uint)0' ! .recv_rtp_sink_0 gstrtpbin ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! videoscale ! autovideosink

    NOTE: Use -v at the end of sending side to see the file caps, which you can later use at the decoder side.

    ---
    ./psnr 176 144 foreman15_600.yuv foreman15_600_recreated.yuv 0 0 foreman_mprtp_old.rtp 15 > psnr_rec.txt
    ---


    ./psnr 176 144 foreman15_600.yuv foreman15_600_recreated.yuv 0 0 foreman_mprtp_old.rtp 15 > psnr_rec.txt
  3. @vr000m vr000m created this gist Jun 15, 2011.
    17 changes: 17 additions & 0 deletions gstreamer.cli
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    YUV -> MP4
    gst-launch filesrc location=<YUV file name> ! videoparse height=144 width=176 framerate=15 ! x264enc name=encoder byte-stream=true bitrate=64 ! mp4mux ! filesink <mp4 file name>

    gst-launch filesrc location=foreman15_600.yuv ! videoparse height=144 width=176 framerate=15 ! x264enc name=encoder byte-stream=true bitrate=64 ! rtph264pay name=packetiser ! fakesink

    MP4 -> YUV
    gst-launch filesrc location=<MP4 file name> ! qtdemux ! ffdec_h264 ! videoparse height=144 width=176 framerate=15 ! filesink locatiion=<YUV file name>

    Stream MP4 file
    gst-launch filesrc location=IM2-YT-2_128k_20.mp4 ! qtdemux ! rtph264pay seqnum-offset=0 timestamp-offset=0 ssrc=0xaaaabbbb mtu=1450 perfect-rtptime=true ! udpsink clients=172.16.183.134:4400 -v

    gst-launch-0.10 udpsrc port=4400 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)\"Z2QAHqw05gLQ9v/ACAAGxAAAAwAEAAADAKA8WLZo\\,aOl4RLIs\", payload=(int)96, ssrc=(uint)2863315899, clock-base=(uint)0, seqnum-base=(uint)0' ! .recv_rtp_sink_0 gstrtpbin ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! videoscale ! autovideosink




    ./psnr 176 144 foreman15_600.yuv foreman15_600_recreated.yuv 0 0 foreman_mprtp_old.rtp 15 > psnr_rec.txt