19

I compiled VLC from the source code and it works well. When I do ". / Vlc" vlc runs. I also compiled ffmpeg from source and it works well too. When I do "ffmpeg-i-f toto.flv mp3-vn-acodec copy new_toto.mp3", the file named "new_toto.mp3" is generated. What I cannot understand is how VLC and ffmpeg work together? What part of VLC code uses ffmpeg code?

Is there a ffmpeg command to play (read) a video?

d-cubed
  • 1,034
  • 5
  • 30
  • 58
Toufik Moad
  • 343
  • 3
  • 4
  • 8

2 Answers2

24

VLC does not embed FFmpeg as a sort of slave binary used internally, as you possibly could suppose. Instead, both FFmpeg and VLC are using libavcodec, a library which implement what ffmpeg exposes through its command line interface. So, FFmpeg supports VLC through supplying its libavcodec library to be one of the essential components on which the VLC is built as a player app.

halfelf
  • 9,737
  • 13
  • 54
  • 63
Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Does VLC make use of libavformat for demuxing, or does it use its own implementation? – sashoalm Jul 18 '12 at 12:19
  • I don't know this, and I suspect it depends on the input/format. Here are the libraries in use: [Demuxers and Muxers](http://wiki.videolan.org/Contrib_Status#Demuxers_and_Muxers). – Roman R. Jul 18 '12 at 12:24
  • thank you for your answer, is there a command ffmpeg to read the contents of a video ? – Toufik Moad Jul 18 '12 at 13:34
  • 1
    It depends on what you understand by "read the contents". FFmpeg is not a player application. Its command line options are described [in documentation](http://ffmpeg.org/ffmpeg.html#Description), or see [19 ffmpeg commands for all needs](http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs). – Roman R. Jul 18 '12 at 13:42
  • I am refactoring an existing project for android that uses VLC. I've been told that using FFmpeg would be better. From what I've read using Google, FFmpeg is more efficient. According to your answer I could use FFmpeg instead of VLC but I'm having a difficult time finding information that would support why I would want to. Do you have any tips or links that would help me articulate why we would choose one over the other? – Patricia Jul 18 '19 at 14:50
6

Is there a ffmpeg command to play (read) a video?

ffplay video.mp4

ffplay is however a very stripped down video viewer, mostly only suitable for debugging video things and not for daily usage.

ffplay may be more accurate than VLC for some quirky formats, for example it can handle very low FPS video where VLC 2.2.4 could not: How to resize a picture using ffmpeg's sws_scale()?

Tested in Ubuntu 16.04, ffmpeg 2.8 with this minimal procedurally generated videos from: How to resize a picture using ffmpeg's sws_scale()?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
  • 1
    +1 for mentioning ffplay, which does a lot to demonstrate that the ffmpeg project is where a lot of the code for decoding and playing media comes from. – mtraceur Sep 12 '22 at 21:40