C + FFmpeg + Raylib = High Quality Videos (YES! It IS that simple!)

preview_player
Показать описание

Chapters:
- 0:00:00 - Announcement
- 0:00:40 - Intro
- 0:07:48 - rendering-video-in-c-with-ffmpeg
- 0:19:49 - Integrating Raylib with FFmpeg
- 0:53:14 - Synchronizing Video with the Sound
- 1:00:47 - Musializer Video Renderer
- 1:56:15 - Troubleshooting Problems
- 2:10:49 - Outro

References:

Socials:

Support:
- BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9
Рекомендации по теме
Комментарии
Автор

Hey! Very nice session! Really enjoyable and educational! Thanks! 😄

Some comments:

- To get color from integer, raylib provides: `Color GetColor(unsigned int hexValue)`
- In raylib all functions that allocate memory start with Load*() and have an Unload*() equivalent
- Moving data from GPU memory to CPU memory (glReadPixels()) is always extremely slow >_<
- I always build raylib with my projects, I usually adjust build parameters (the ones in config.h) despite with LTO it is not really needed...
- Wave is for "audio frames" the same than Image for "pixels", "audio frames" and "pixels" have a number of channels and a size for each channel
- raylib provides TextFormat() that works like sprintf(), returning a static string formated, very handy for things like DrawText(TextFormat("FPS: %i", GetFPS()), 10, 10, 20, GREEN);

raylibtech
Автор

There are two kinds of people "We cant malloc two times in a single frame" and then every game dev currently "haha memory goes

TVELP
Автор

Alexey, great work! Your recreational sessions are super inspiring. Thank you so much! <3

heyyouhere
Автор

I would pay so much money to learn from someone as exceptional as you man

winstonstrongarm
Автор

Huh, I always saw ffmpeg as some sort of blackbox utility that only the oldest of elders knew the magical sequences to cast its spell properly... But your explanation makes a lot of sense!

Now I too can cast ffmpeg >:D

russjr
Автор

Some time ago, when I wrote some code to generate frames and pipe them into FFMPEG, I thought: "meh, this is crazy". Now I feel so normal since there are clever people doing something similar... Thanks for the great content!

ecosta
Автор

I really agree with what you said about passion in this industry, I dropped out of uni and during the first year of my current job, I learned two languages and how to write big code bases using them, I learnt how to setup devops pipelines and implement IaC.
Now it's become obvious that no one except me cares whether anything is done well or properly. They are killing off the two deploy clusters I set up because they don't want to learn Linux, so the full logging, tracing and metrics system I set up is being replaced with Windows Event Log xD.

I know I need to leave and find a placee where I can be with passionate people, I'm just starting to worry whether I'm going to be as passionate as I was when I started in Grade 6😂

winstonstrongarm
Автор

Unexpected and enjoyable discussion about the passion-quenching effects of working in corporate programming jobs. Definitely been there and got burnt a few times.

batlin
Автор

5:27 you just have to dig
I've got a job where I'm free to do things however I like (luckily, I didn't have to dig much). Having to solve real world problems is much more satisfying because you're fulfilling a purpose and have actual constraints and users

the_original_dude
Автор

Great job as always!

Would be awesome to see you take a shot at building a concurrent web server in C, or maybe sth like reimplementing Golang's 'net' or 'net/http' module in C

adel
Автор

Hi Alexey, I found this strange Icon on my phone with an X and opened it and it showed me something which looked like a retweet of you tweeting about musializer… My goto 3D Framework unfortunately does not have very good support for audio yet (not possible to access audio data while playing a Song) and I never had used Raylib before but I thought I would just have a look at the website. Next thing I know I made a Raylib hello world from C# project (since I am too lazy to learn C). I then started to port musializer to C#. Was not expecting it to work out but surprisingly it did after a day so that I am having fun with it playing random music and looking at the visualization. The render to video part is still missing though. Thanks for the cool project!

kwyrky
Автор

Did you know that Tsioding is #13 most viewed twitch programmist?

antonsimkin
Автор

30:00 I would use an union to do that, it's far more clear what it's doing when you do:
union {
Color color;
uint32_t abgr;
} convert;
convert.abgr = 0xFF181818;

caio_c
Автор

It doesn't have to be an array btw, the following works too:

*(uint32_t*)&(Color){.r=255, .g=127, .b=255, .a=255}
You can kinda do that with anything, like here is how to print the current time with libc's time.h in a single line:
printf("%s",
coumpound literals are a c99 feature and they're great :)

afasd
Автор

The sample at 1:30 is obviously epic but it's frustrating to me that when the drums kick in you don't get a much bigger impact on the visualization. I guess that makes sense since (I'm guessing) drums are kind of like white noise, so adding in drums just gives you a slight increase to every frequency, rather than a dramatic increase to a few frequencies.

Jack-sydi
Автор

Bro is so smart that codes videos with c

fantastikam
Автор

27:06 damn! I had no idea you could do such a thing. I was thinking you'd have to delve into bit shifting to get all the components and build a color struct.

skaruts
Автор

Hi and thanks for the great video, very entertaining and a cool little project. Maybe you could implement Hardware/GPU Encoding with the H264 NVIDIA NVENC (`-c:v h264_nvenc`) or for AMD (`-c:v h264_amf` ? ). This could significantly speed up the encoding process. Looking forward to more content like this! Great stuff 👍

Dan-Levi
Автор

Ooh if this were to work with alsa/pulseaudio, then I would use it as a wallpaper!

dtomvan
Автор

curious if it's possible to have the rendering not be bound by the music's playtime, so you could potentially render faster no matter how long the track is, since it's just simulated anyways.

alack