Join us on Discord!
You can help CodeWalrus stay online by donating here.

How to code an mp4 video

Started by Ephraim Becker, November 27, 2015, 01:40:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Travis

You probably aren't finding tutorials because "program an MP4" is not a phrasing that makes sense to most people. What do you want the program to do, exactly? What will appear on the screen when you run it? Does it do anything in response to keyboard or mouse input, and what? What will get stored on the hard drive?

Please consider explaining what you mean, without repeating the same sentence over and over, because that will not help us understand you. If you again respond to this post with something substantially similar to "I want to program/code an MP4 file...", I'm personally going to give up and stop participating in this thread because it's clear I'm not able to help you, and I'm afraid others might do the same.
  • Calculators owned: TI-81, TI-82, TI-85, TI-86, TI-89, TI-89 Titanium, 2 × HP 50g

Ephraim Becker

What I mean is instead of taking a video with a video camera, I want to code the video. I'm expecting my C program, main.c, to compile down to main.mp4 and when I click on it, it will open up in a video player (example: Windows Media Player) and play the video I coded in C. The problem is that I don't know how to do that.
  • Calculators owned: TI 84 Plus, TI 84 Plus C Silver Edition, TI 84 Plus CE, Casio FX-9750 GII
I have Aspergers Syndrome

Dream of Omnimaga

Do you mean a C program that generates each frame pixel by pixel, like people do with PHP images? (examples: Cemetech, Omnimaga and CodeWalrus post statistic graphics)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Ephraim Becker

Don't I need to start by making a lot of images?
  • Calculators owned: TI 84 Plus, TI 84 Plus C Silver Edition, TI 84 Plus CE, Casio FX-9750 GII
I have Aspergers Syndrome

Yuki

Okay I think I know what he wants to do. Dynamically-generated MP4 files, just like the GD library we use in PHP to dynamically generate images, but for MP4s.

Theorically, you could, you could code an animation in C and stitch all the images in a MP4. But it's pretty hard without a library.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

Ephraim Becker

Is there an official mp4 C library?
  • Calculators owned: TI 84 Plus, TI 84 Plus C Silver Edition, TI 84 Plus CE, Casio FX-9750 GII
I have Aspergers Syndrome

Ivoah

I would use Processing to make an animation and then use a screen recorder to record it.
  • Calculators owned: TI-86 (now broken), TI SR-56, TI-Nspire CX CAS, TI-84+ SE, TI-84+ SE, TI-85, TI-73 Explorer VS, ViewScreen, TI-84+ CSE, TI-83+ SE

bb010g

You are not asking good questions.

Stop that.

To help you, I'm going to leave these here: How To Ask Questions The Smart Way, and The Help Vampire: A Spotter's Guide. Read them.

I've been holding off on posting these. CodeWalrus is normally a pretty friendly place. We try to help people, even if we have to go out of our ways to try and decipher their questions, code, or whatever. We don't want to make people feel unwelcome.

However, these people normally, over time, hone their problem solving-fu and figure out how to search more effectively, how to think more effectively, and how to ask questions more effectively. You have not done any of that. You, in this thread alone, have managed to provide little information and have ignored our requests for clarification. Thus, you have received little help, and this thread could very well be considered a waste of time for all involved. None of us want this.

We continually try to divine meaning from you because we want you to succeed. Your determination is admirable, but there's a reason we tell you to not start with ASM, indent your JS, and not try to reverse engineer drivers for Windows. Those things are hard, and we've seen many people try them and fail, becoming discouraged. We love programming, and we want you to love it too. This forum interaction is a give and take between everyone. If we're going to give you help so we can experience the fruits of your labor, you have to take some of our advice and put in some effort.

We are not your personal human search engine. This is covered in How To Ask Questions The Smart Way, which you should go back and read if you haven't yet. Being a search engine takes time and is boring; that's why computers do it.

Again, we want to help you. Help us help you.
  • Calculators owned: HP 50g, Prime, 28S, 35S, Casio Prizm, dead Nspire CX CAS

Dream of Omnimaga

Quote from: Ephraim Becker on November 27, 2015, 03:49:19 AM
Don't I need to start by making a lot of images?

Depends. If your video is 90 minutes long, uncompressed, 24-bits colors at 1080p resolution, then I think you will need 938.5 GB of RAM. So in some cases, pre-rendering would not be recommended. :P



Quote from: bb010g on November 27, 2015, 04:37:09 AM
You are not asking good questions.

Stop that.

To help you, I'm going to leave these here: How To Ask Questions The Smart Way, and The Help Vampire: A Spotter's Guide. Read them.

To be fair, we aspergers don't like long texts due to our relatively short attention span, so perhaps a shorter version, or directing him to the most important points, if your post is missing any, might be a better solution.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Ephraim Becker

Quote from: DJ Omnimaga on November 27, 2015, 04:41:28 AM
Quote from: Ephraim Becker on November 27, 2015, 03:49:19 AM
Don't I need to start by making a lot of images?

Depends. If your video is 90 minutes long, uncompressed, 24-bits colors at 1080p resolution, then I think you will need 938.5 GB of RAM. So in some cases, pre-rendering would not be recommended. :P

I only have 4 GB of RAM. I do want to make a long video. Is there anyway I can do this with 4 GB of RAM?
  • Calculators owned: TI 84 Plus, TI 84 Plus C Silver Edition, TI 84 Plus CE, Casio FX-9750 GII
I have Aspergers Syndrome

Snektron

You don't want to code an mp4 video, you want to make a program that generates an mp4 video. There are already programs for this, like blender etc, but if you really want to you can do it in C. What you would need is some way to generate frames, then put them into a mp4 file. You would probably need to learn the ffmpeg api and create the neccesary drawing functions yourself though. You need a main loop which loops though all the images (say you want to create a 60 second animation at 30 fps you loop 1800 times).

A better approach would probably to get a library like SDL output to a mp4 file...
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Dream of Omnimaga

Quote from: Ephraim Becker on November 27, 2015, 01:42:58 PM
Quote from: DJ Omnimaga on November 27, 2015, 04:41:28 AM
Quote from: Ephraim Becker on November 27, 2015, 03:49:19 AM
Don't I need to start by making a lot of images?

Depends. If your video is 90 minutes long, uncompressed, 24-bits colors at 1080p resolution, then I think you will need 938.5 GB of RAM. So in some cases, pre-rendering would not be recommended. :P

I only have 4 GB of RAM. I do want to make a long video. Is there anyway I can do this with 4 GB of RAM?
http://downloadmoreram.com/


But more seriously, what Cumred said
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal