Guest User

Untitled

a guest
Sep 29th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # play YUV444 FULL HD file
  4. gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
  5. videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
  6. videoconvert ! \
  7. autovideosink
  8.  
  9. # play YUV422 FULL HD file
  10. gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
  11. videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y42B ! \
  12. videoconvert ! \
  13. autovideosink
  14.  
  15. # play YUV422 FULL HD file
  16. gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
  17. videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y42B ! \
  18. videoconvert ! \
  19. autovideosink
  20.  
  21. # make PNG from YUV420
  22. gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
  23. videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y42B ! \
  24. videoconvert ! \
  25. pngenc ! multifilesink location=img%03d.png
  26.  
  27. # play MP4 FULL HD file
  28. gst-launch-1.0 filesrc location=test.mp4 ! \
  29. decodebin name=dec ! \
  30. queue ! \
  31. videoconvert ! \
  32. autovideosink dec. ! \
  33. queue ! \
  34. audioconvert ! \
  35. audioresample ! \
  36. autoaudiosink
  37.  
  38. # play MP3
  39. gst-launch-1.0 filesrc location=test.mp3 ! decodebin ! playsink
  40.  
  41. # play OGG
  42. gst-launch-1.0 filesrc location=test.ogg ! decodebin ! playsink
  43.  
  44. # play MP3 over UDP + RTP
  45. # sender:
  46. gst-launch-1.0 -v filesrc location=test.mp3 ! \
  47. decodebin ! \
  48. audioconvert ! \
  49. rtpL16pay ! \
  50. udpsink port=6969 host=192.168.1.42
  51. # receiver:
  52. gst-launch-1.0 -v udpsrc port=6969 \
  53. caps="application/x-rtp, media=(string)audio, format=(string)S32LE, \
  54. layout=(string)interleaved, clock-rate=(int)44100, channels=(int)2, payload=(int)0" ! \
  55. rtpL16depay ! playsink
  56.  
  57. #play webcam video over UDP with h264 coding
  58. #sender
  59. gst-launch-1.0 v4l2src ! \
  60. 'video/x-raw, width=640, height=480, framerate=30/1' ! \
  61. videoconvert ! \
  62. x264enc pass=qual quantizer=20 tune=zerolatency ! \
  63. rtph264pay ! \
  64. udpsink host=192.168.1.140 port=1234
  65. #receiver
  66. gst-launch-1.0 udpsrc port=1234 ! \
  67. "application/x-rtp, payload=127" ! \
  68. rtph264depay ! \
  69. avdec_h264 ! \
  70. videoconvert ! \
  71. xvimagesink sync=false
  72.  
  73. #play RAW webcam video over UDP (+RTP) without any coding
  74. #sender
  75. gst-launch-1.0 -v v4l2src ! 'video/x-raw, width=(int)640, height=(int)480, framerate=10/1' ! \
  76. videoconvert ! queue ! \
  77. rtpvrawpay ! queue ! \
  78. udpsink host=127.0.0.1 port=1234
  79. #receiver
  80. gst-launch-1.0 udpsrc port=1234 ! \
  81. "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, \
  82. sampling=(string)YCbCr-4:2:2, depth=(string)8, width=(string)640, height=(string)480, \
  83. ssrc=(uint)1825678493, payload=(int)96, clock-base=(uint)4068866987, seqnum-base=(uint)24582" ! \
  84. rtpvrawdepay ! queue ! videoconvert ! autovideosink
  85.  
  86. #save RAW video from webcam to file
  87. gst-launch-1.0 -v v4l2src ! 'video/x-raw, width=(int)640, height=(int)480, framerate=10/1' ! videoconvert ! filesink location=out.yuv
  88.  
  89. #play RAW video from file
  90. gst-launch-1.0 filesrc location=out.yuv ! videoparse width=640 height=480 format=GST_VIDEO_FORMAT_YUY2 ! videoconvert ! autovideosink
Add Comment
Please, Sign In to add comment