Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Lastblow

  • Rank

Personal Information

  • Interests
  1. Lastblow

    include video files in OpenGL...

    As promised, video.cpp here attached plays a mp4 video whose codecs appear below. Based on http://dranger.com/ffmpeg/, running Windows x64, Visual Studio 2015, SDL2, ffmpeg 4.0 and C++. Hope it helps! Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘crawl.mp4’: Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 creation_time : 1970-01-01T00:00:00.000000Z Duration: 00:00:29.00, start: 0.000000, bitrate: 689 kb/s Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1344x680, 612 kb/s, 10 fps, 10 tbr, 10 tbn, 20 tbc (default) Metadata: creation_time : 1970-01-01T00:00:00.000000Z handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 75 kb/s (default) Metadata: creation_time : 1970-01-01T00:00:00.000000Z handler_name : SoundHandler screen final size: 1344x680 video.cpp
  2. Lastblow

    include video files in OpenGL...

    Thank you for your quick reply, Finalspace! Will look into it and keep you updated. ;-))) In fact, was trying to avoid extra dependencies but FFmpeg may be the way to go for my software to remain cross-platform, per a similar post on stackoverflow. Also posted in NeHe Productions forum concerning the null pointer in their tutorial. Copy both links here below for reference. https://stackoverflow.com/questions/39059959/vfw-avistreamgetframeopen-returns-null https://www.gamedev.net/forums/topic/697579-avistreamgetframeopen-returns-nullptr/
  3. Hey, hey, hey! Would like to include in my game 2 short avi videos I made in Blender. Went over NeHe lesson 35, it reads the supplied avi file but when I try to read my avi files, they both give nullptr for lpbi because of pgf being nullptr on line 106, see below. There is a similar post on stackoverflow, link here below as well. Would you, please, update the tutorial, please? Thank you so very much! ;-))) PS. Here attached one of the avi files I am trying to read. pgf=AVIStreamGetFrameOpen(pavi, NULL); // Create The PGETFRAME Using Our Request Mode if (pgf==NULL) { // An Error Occurred Opening The Frame MessageBox (HWND_DESKTOP, "Failed To Open The AVI Frame", "Error", MB_OK | MB_ICONEXCLAMATION); } https://stackoverflow.com/questions/39059959/vfw-avistreamgetframeopen-returns-null carve.avi
  4. Hi, first post here! Been reading png files in SDL and using them as textures... Now, would like to include in my game 2 short videos made in Blender, in dvi and mp4 formats. Went over NeHe lesson 35 but when I try to read the dvi file, it gives null pointer for lpbi, see below. Is it possible to include video files in OpenGL and how, please? ;-))) void GrabAVIFrame(int frame) // Grabs A Frame From The Stream { LPBITMAPINFOHEADER lpbi; // Holds The Bitmap Header Information lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pgf, frame); // Grab Data From The AVI Stream pdata=(char *)lpbi+lpbi->biSize+lpbi->biClrUsed * sizeof(RGBQUAD); // Pointer To Data Returned By AVIStreamGetFrame // Convert Data To Requested Bitmap Format DrawDibDraw (hdd, hdc, 0, 0, 256, 256, lpbi, pdata, 0, 0, width, height, 0); flipIt(data); // Swap The Red And Blue Bytes (GL Compatability) // Update The Texture glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, 256, 256, GL_RGB, GL_UNSIGNED_BYTE, data); }
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!