site  contact  subhomenews

Fundamental questions about multimedia packages

January 01, 2010 — BarryK
There is discussion about .3g2 video files playing video but no sound:

http://murga-linux.com/puppy/viewtopic.php?t=50409

In Quirky I have just been through the exercise of recompiling ffmpeg (from svn, December 29), with libopencore-amr, x264 and xvid support, as well as all the usual packages in Puppy/Quirky.

But, I was very disappointed when I played the .3g2 files in Gxine and still no sound.

Then I tried 'ffplay', a console video player, and hey, I get sound!

Gposil has been through the same exercise for Dpup, and has also commented how good ffplay is. Incidentally, note that ffplay needs libSDL, so there is a bonus for games if we decide to put ffplay into our puppies.

Anyway, all of this is making me rethink the fundamentals. I've got Swfdec-mozilla compiled against ffmpeg and doing a pretty good job as a Flash player plugin. Well, here are the questions:

1. x264, xvid
I am not really clear on why we need these dependencies in ffmpeg. In my general rambling around on the Internet, ffmpeg seems to handle everything, well most files, without these dependencies. What files/streams are going to need these dependencies? In other words, is it really important to have ffmpeg compiled with these dependencies?

2. Why do we need xine?
If ffplay can do such a good job at playing videos, and something else such as Pmusic can play audio files, and pCD play audio CDs (I don't know about DVD videos though), why do we need xine and gxine?

Regarding question 2, couldn't we develop our own wrapper for ffplay? Ffplay can even toggle full-screen:
http://linux.die.net/man/1/ffplay

Comments

FFplay
Username: gposil
As you are aware, Dpup does not use gxine or xine, 90% of i't movie playing is done by ffplay, and we only have Mplayer in Dpup for dvd playback(that is also soon to change, Mplayer will go replaced by Dpup's own custom dvd player with full menu support). I am in the prcess of writting a wrapper for ffplay at the moment...with ffplay at only 48k and it's only dependency libSDL it is a fraction of the size of gxine/xine, and plays far more movie formats than gxine could ever hope to. At the moment ffplay is controlled by these keys: q, ESC quit f toggle full screen p, SPC pause a cycle audio channel v cycle video channel t cycle subtitle channel w show audio waves left/right seek backward/forward 10 seconds down/up seek backward/forward 1 minute mouse click seek to percentage in file corresponding to fraction of width . As for x264/xvid, they are the just about the 2 best compression formats avaible for movies, in terms of the size/quality trade-off. Hope that helps

xine
Username: kirk
"Most use Xine because of it's DVD menu support. I haven't used FFplay. I agree with gposil, x264 seems to be the best video codec around. Very popular.

x264 & XviD
Username: superpup
"x264 is *extremely* popular. So is XviD. Keep them.

###
Username: John Doe
" > ... is it really important to have ffmpeg compiled with these dependencies? perhaps for encoding and not for decoding?

Ffplay
Username: BarryK
"gposil, Your thinking is along the same lines as my first post in this thread, except that you are way ahead! Your own custom DVD player -- wow! (not based on 'Ogle' by any chance?)

x264, Xvid
Username: tempestuous
"These are both [u]encoding[/u] libraries, for the two most popular video codecs: H264 and Xvid respectively. ffmpeg doesn't require either library for playback (decoding) of these two codecs. But the inclusion of ffmpeg, in Puppy's history, was for encoding purposes, via plinej's various utilities. So from an encoding perspective, ffmpeg is only half-complete without x264 and Xvid. H264 and its cousin AVC are usually found within the MPEG4 (MP4) file container, and are used in BluRay video discs. Xvid is usually found within the matroska (MKV) or AVI file containers. Given that both codecs are fully supported in ffmpeg for decoding, in order to save space in Puppy you could make the decision to support just one or the other for encoding support. In this case I would go for Xvid, since it's more closely aligned with the opensource community.

Front end
Username: tempestuous
"Yes, gposil's customised front end is a commendable initiative. Let's face it, that's exactly what MPlayer/Xine/VLC do - provide a front end for decoding libraries and a playback engine. A lot of the "bulk" of these applications is in the interface - the skin, buttons, menu, etc. But be careful what you do with backend code which handles things like progress bars, track display etc. This can end up being CPU-heavy. That's my gripe with Pmusic.

Your own custom DVD player -- wow! (not based on 'Ogle' by any chance?)
Username: gposil
"Barry, How'd you guess...it hasn't been maintained in years and yet it is light years ahead of anything current...and 10% the size of Mplayer. So i'm doing some code re-writting to update it slightly.

ffmpeg
Username: zigbert
"I really like this discussion!!!! ffmpeg has many areas of use - format converting - play audio/video - record video/audio - capture desktop - streaming xine (gxine) in Puppy works much better with internet radio-streaming than ffmpeg (pmusic). ffmpeg in Puppy seems to be compiled without support of common streaming formatsas realaudio and realmedia. Also, for some reason ffmpeg buffering time is huge compared to xine (wma/mp3). - This might become of my limited skills..... It is possible to compile support of screen-recording (capturing) with ffmpeg. [i]ffmpeg -f x11grab -s cif -i :0.0 /tmp/out.mpg[/i] ....but Puppy misses the X11grab module. The following command records my webcam: [i]ffmpeg -y -f oss -i /dev/audio -f video4linux2 -s qvga -i /dev/video0 ~/a.avi[/i] You don't want to see the result :) The second interesting question will be; how to benefit of the inclusion of libsdl......

sdl
Username: ttuuxxx
"Hi Zigbert as sdl goes, its a really small library, its only after you add all the other sdl plugins it can get big, but sdl by itself is great, there are tons of small games, applications etc, Tell you the truth I would take sdl over vala any day, have a look at the forum http://www.google.com/search?q=sdl&sitesearch=http://www.murga-linux.com/puppy/ 465 pages related to sdl, mostly games. ttuuxxx

x11grab
Username: BarryK
"zigbert, Thanks for mentioning that. I'm planning to recompile ffmpeg tonight or tomorrow morning, and I'll make sure "x11grab" is enabled. ttuuxxx, sdl and vala are two different things. Vala is just a programming language and it can use libSDL just as any other program written in C or C++. Yes, the SDL package only has a library. It will be interesting to see what we can do with it. Ttuuxxx, are any of those SDL games really small? -- it probably is time I put some new ones in, as PicPuz, Rubics Cube and Xsoldier have been there for a long time.

x11grab & ffmpeg tools
Username: technosaurus
"This will be a great promo tool [b]desktop video (and audio) capture[/b] ffmpeg -f oss -i /dev/audio -f x11grab -s 1200x800 -r 5 -i :0.0 ~/x11-session.avi [b]webcam (and audio) capture[/b] ffmpeg -y -f oss -i /dev/audio -f video4linux2 -s qvga -i /dev/video0 ~/a.avi [b]take (3) jpeg webcam pictures[/b] - similar for screenshot with X11grab ffmpeg -y -r 1 -t 3 -f video4linux2 -s vga -i /dev/video0 ~/camshot%d.jpeg These can be combined in a gui fairly easily... may Woo-FF?

SDL Small Games
Username: ttuuxxx
"hi Barry there's a burgertime game http://www.murga-linux.com/puppy/viewtopic.php?t=21427 a nice memory game http://www.murga-linux.com/puppy/viewtopic.php?t=23998 beat the clock game http://www.murga-linux.com/puppy/viewtopic.php?t=31499 a chess game http://www.murga-linux.com/puppy/viewtopic.php?t=28494 connect 4 game http://www.murga-linux.com/puppy/viewtopic.php?t=28984 tiny tetris game http://www.murga-linux.com/puppy/viewtopic.php?t=22270 small digdug game http://www.murga-linux.com/puppy/viewtopic.php?t=20890 well that is a start :)

more sdl games
Username: technosaurus
"This should cover most of the rest of SDL games http://www.libsdl.org/games.php?order=name&category=-1&completed=100&os=1&match_name=&perpage=-1 http://freshmeat.net/search?q=sdl&submit=Search

more sdl games
Username: technosaurus
"This should cover most of the rest of SDL games http://www.libsdl.org/games.php?order=name&category=-1&completed=100&os=1&match_name=&perpage=-1 http://freshmeat.net/search?q=sdl&submit=Search

x264 and xvid
Username: Dougal
"As tempestuous noted, they're only needed to add encoding support to ffmpeg, so you might want to leave them out and just have any encoding frontends depend on them. (note that Debian disables support for those encoders -- and FAAC -- in ffmpeg/Mencoder due to licensing issues.) What you _should_ include is support for Theora. he latest version (1.1) is much better than before and is supposed to be practically better than h264. (I actually asked the developer about this and he said that h264 is _theoretically_ capable of batter quality video, but it is not practical due to the resources required for it: apparently, for the same quality h264 and Theora, h264 requires 3x cpu usage for decoding and 10x for encoding. I know I can't even watch the 480p h264 videos from Youtube without passing Mplayer a bunch of parameters to degrade the quality to that of a TV with bad reception...)

RealMedia
Username: gposil
"zigbert said: "ffmpeg in Puppy seems to be compiled without support of common streaming formatsas realaudio and realmedia." ffmpeg support for RealMedi/RealAudio is not gpl so any ffmpeg compiles done for Puppy cannot include them, as the non-gpl ffmpeg is un-redistibutable in the words of ffmpeg developers. Just thought i'd clarify that...what you do yourselves later is up to you, but the distro will not include non-gpl codecs in ffmpeg.

re:RealMedia
Username: ttuuxxx
"http://www.real.com/linux You could always just make a Realmedia player package with rox mime types included so it plays those files by default. Real player also plays windows media files by default. really expanding realplayers plugins would probably make the best allround legit media player. ttuuxxx


Tags: puppy