Reputation: 1135
What I am trying to code
Would want to simulate this for a CLI pipeline to make sure the video caps is working:
My attempts as follows: gst-launch-1.0 filesrc location=video.mp4 ! appsink name=mysink ! appsrc name=mysrc ! video/x-h264 width=720 height=480 framerate=30/1 ! h264parse config-interval=1 ! rtph264pay name=pay0 pt=96 ! udpsink host=192.168.x.x port=1234
But this doesnt really works and I not too sure this is how appsrc and appsink is used
Can some one enlighten me
EDIT: The file i am trying to play has the following property
General Complete name : video3.mp4 Format : AVC Format/Info : Advanced Video Codec File size : 45.4 MiB
Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=30
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 3:2
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Thanks
Upvotes: 1
Views: 1750
Reputation: 2733
You won't be able to do this with appsink
and appsrc
, as these are explicitly meant to be used by an application to handle the input/output buffers.
That being said, if what you really want is to test the caps on both sides, just connect them together. They both advertise "ANY" caps, which means they won't really influence the caps negotiation.
gst-launch-1.0 filesrc location=video.mp4 ! \
"video/x-h264, width=720, height=480, framerate=30/1" ! \
h264parse config-interval=1 ! \
rtph264pay name=pay0 pt=96 ! \
udpsink host=192.168.x.x port=1234
You'll get an error also, since MP4 is not the same as H264: the former is a container format, while the latter is a video codec. In your case, the MP4 file will probably contain an H.264 video: in that case, it should work by putting a qtdemux
element after the filesrc
.
Upvotes: 2