c++ - Video players questions -
c++ - Video players questions -
given ffmpeg leading multimedia framework , of video/audio players uses it, i'm wondering somethings audio/video players using ffmpeg intermediate.
i'm studying , want know how audio/video players works , have questions.
i reading ffplay source code , saw ffplay handles subtitle stream. tried utilize mkv file subtitle on , doesn't work. tried using arguments such -sst nil happened. - reading subtitles , how video files uses (or may containers?). saw there's 2 ways putting subtitle: hardsubs , softsubs - speaking hardsubs mode burned , becomes part of video, , softsubs turns stream of subtitles (i might wrong - please, right me).
the question is: how handle this? mean, when subtitle part of video there's nil do, video stream shows subtitle, softsubs? how handled? (i heard text subs well). - how subtitle appears on screen , can configured changing fonts, size, colors, without encoding again?
i studying video players source codes , or of them uses opengl renderer of frame , others uses (such qt's qwidget) (kind of or sure) canvas. - used , 1 fastest , better? opengl shaders , stuffs? handling yuv or rgb , on? how work?
it might dump question format avframe returns? example, when want save frames images first need frame , convert, format converting from? alter according video codec or it's same?
most of videos i've been trying handle using yuv720p, tried save frames png , need convert rgb first. did test players , set @ same frame , took screenshots , compared. video players shows frames more colorful. tried same ffplay uses sdl (opengl) , colors (quality) of frames seems low. might be? do? shaders (or kind of magic? haha).
well, think now. hope help me that.
if isn't right place, please allow me know where. haven't found place in stack exchange communities.
there lot of question in 1 post:
how 'soft subtitles' handled
the same way other stream :
read packets stream container give packet decoder use decoded frame wish. here containers supporting subtitles presentation time present. need @ time text , fire onto image @ same presentation time. there lot of ways print text on video, ffmpeg or librarywhat used renderer , 1 fastest , better?
most used depend on underlying system. instance qt wrap native renderers, , has opengl version you can fast underlying scheme allows. back upwards ouble-buffering? can render in decoded pixel format or have perform color conversion before? topic broad better depend on utilize case. broadwhat format avframe returns? raw format (enum avpixelformat
), , depends on codec. there list of yuv , rgb fourccs cover formats in ffmpeg. programmatically can access table avcodec::pix_fmts
obtain pixel format specific codec support.
c++ c ffmpeg libavcodec libav
Comments
Post a Comment