unosquare / ffmediaelement

FFME: The Advanced WPF MediaElement (based on FFmpeg)
https://unosquare.github.io/ffmediaelement/
Other
1.18k stars 244 forks source link

Playing .wmv problem and Recording problems #413

Closed JohnsonGao closed 5 years ago

JohnsonGao commented 5 years ago

Good Project! First time to evaluate and I found two problems currently:

1) when playing Wildlife.wmv in windows 7 sample videos, cannot display video normally, only rendering green backgroud onto display area, but audio sounds good, and overlay texts Clock, PN, A/V, A/C, L, R are all ok.

2) Recording parts problems: a) input media file can be recorded but not all players can play the result(.mov), e.g. VLC can play but the time of start looks wrong, windows media player has the same playing performances almost, and other players cannot play at all. b) input devices like webcam or desktop, can play normally in display area, but when triggered to recording, looks good for recording results(.ts), but after stopped, no any player can play the ts media file.

Did you meet these situations? Thank you !

mariodivece commented 5 years ago
  1. Yes, that is your video card failing to decode wmv files. Disable video decoding hardware acceleration and it will work fine.
  2. The recording part I am providing a sample for is to show that it is possible to capture the packets and record them but it does not do any recoding at all. That is up to the user (you) and I don't mean to be rude but your question seems like you need a lot more experience in media codecs and recoding will be something you might be able to do after putting in a lot of effort and research.
JohnsonGao commented 5 years ago

Thanks for your quick reply!

  1. But windows media player and VLC can play the wmv file fine on the same machine. Can I think that windows media player and VLC all using soft-decoder to play it, right?
  2. I'm learning media dev skills now, and hope to learn more from you cool guys. : ) Thank you.
mariodivece commented 5 years ago
  1. This lib is using FFmpeg where you can set the video hardware device context (CUDA, D3D or DXVA) for decoding in FFME. You can easily disable it (recommended). In the sample application you could simply not set the VideoHardwareDevice https://github.com/unosquare/ffmediaelement/blob/028d691ea31ff4651703996dbee33df27d1d05cf/Unosquare.FFME.Windows.Sample/MainWindow.MediaEvents.cs#L250

  2. It's certainly a journey and it requires a lot of reading, practice, and patience. Check out the following resources to get started: http://dranger.com/ffmpeg/ https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples https://www.ffmpeg.org/doxygen/4.1/group__lavc__encdec.html