The shoutbox is currently out of service. Join us on Discord instead.
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.

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.
I have Aspergers Syndrome

DJ 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)

Ephraim Becker

Don't I need to start by making a lot of images?
I have Aspergers Syndrome

Juju

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.
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?
I have Aspergers Syndrome

Ivoah

I would use Processing to make an animation and then use a screen recorder to record it.

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.

DJ 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.

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?
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...
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


DJ 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

Powered by EzPortal