all. I'm a beginner of programming and I met some difficulties on video decoding/playing.
I have raw h264 data stream from tcpsocket
, and I want to show the video on a WPF usercontrol
.
Since I have few knowledge of C++ & video decoding/encoding, it will be hard to use ffmpeg
for me.
So I'm considering if VLC can do this.
The background is: I want to use Scrcpy server build my own "Android screen cast & remote control" WPF application.
So far, I've implemented:
- Push server to device and start the server
- Establish TCP connection between PC and Android device
- Can see h264 raw data streaming in the socket
Then the next step is: show video on a WPF usercontrol
Actually I've tried another solution before and can get what I want
- Use MPV as a media player
- Start
mpv.exe
process in my app with specific arguments - Embed mpv window in a WPF host element
But I think <WindowsFormsHost/>
is not perfect for a WPF application, So I'm trying to find a WPF-style way.
When I searching the Github, I found it is easier if I want to play a media file from disc or internet, I just need to pass the file location (e.g. D:/MyFolder/mySampleVideo.mp4
or http://somesite/aSampleVideo.flv
) and no need to care about how the component/element work.
Like this project and this project
If I use the VLC, how can I directly play the raw h264 data stream?
Is there a method like VlcPlayer.Play(NetworkStream myh264stram) {...}
?