Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Play Raw Video Streams
Raw YUV Streams
libavformat supports raw video streams that only contains video frame data without any other information.
To get a raw yuv stream for testing, you can run
ffmpeg -i test.mp4 -c:v rawvideo -pix_fmt yuv420p test.yuv
To play the yuv stream with ffplay
ffplay -f rawvideo -pix_fmt yuv420p -s 1280x720 -i test.yuv
To play the yuv stream in QtAV player, you have to set some options for libavformat like ffplay does.
Open Setup dialog->Open AVFormat tab->Fill Extra with
format_whitelist=rawvideo video_size=1280x720 pixel_format=yuv420p framerate=25->Play test.yuv
You can also setup in C++ code
QVariantHash fmt_opt; fmt_opt["format_whitelist"] = "rawvideo"; // since QtAV 1.6 (or since commit e828f9c4) fmt_opt["video_size"] = "1280x720"; fmt_opt["pixel_format"] = "yuv420p"; fmt_opt["framerate"] = 25; player->setOptionsForFormat(fmt_opt); player->setFile("test.yuv"); player->play();
Raw H.264 Streams
If a raw h264 stream does not have timestamp information, you must force a frame rate to the player.
It's different from raw yuv streams because we can compute the frame number by size for a raw yuv stream.