Jump to page: 1 2
Thread overview
MP4 Library
Aug 19, 2024
Ron Tarrant
Aug 20, 2024
Jordan Wilson
Aug 20, 2024
Ron Tarrant
Aug 21, 2024
Elias Batek
Aug 22, 2024
IchorDev
Aug 26, 2024
Paolo Invernizzi
Sep 20
IchorDev
Mar 04
Sergey
August 19, 2024

Hi all,
Anyone know of a library similar to OpenCV that can be used from D to create MP4 files from a series of images? I think I came across some mention of OpenCV bindings, but I can't find it now.

Any help would be most welcome and appreciated. Thanks.

August 20, 2024

On Monday, 19 August 2024 at 18:18:57 UTC, Ron Tarrant wrote:

>

Hi all,
Anyone know of a library similar to OpenCV that can be used from D to create MP4 files from a series of images? I think I came across some mention of OpenCV bindings, but I can't find it now.

Any help would be most welcome and appreciated. Thanks.

dcv might be something you are interested in looking at.
I've used dmagick + process pipes to ffmpeg myself, and found it pretty straightforward (dmagick might be heavy for your use, if it's just simply image loading there'll be more lightweight libs available I imagine).

Jordan

August 20, 2024

On Tuesday, 20 August 2024 at 03:32:03 UTC, Jordan Wilson wrote:

>

dcv might be something you are interested in looking at.

>

I've used dmagick + process pipes to ffmpeg myself

Thanks, Jordan. I'll check those out.

August 21, 2024
On Tuesday, 20 August 2024 at 03:32:03 UTC, Jordan Wilson wrote:
> process pipes to `ffmpeg`

By the way, there’s a wrapper for this exact purpose in arsd:
https://github.com/adamdruppe/arsd/blob/master/pixmaprecorder.d
August 22, 2024

On Monday, 19 August 2024 at 18:18:57 UTC, Ron Tarrant wrote:

>

Hi all,
Anyone know of a library similar to OpenCV that can be used from D to create MP4 files from a series of images? I think I came across some mention of OpenCV bindings, but I can't find it now.

Any help would be most welcome and appreciated. Thanks.

If you know how to use ffmpeg as a library then there’s very good bindings in the form of ffmpeg-d. If you have never used ffmpeg as a library then I’ll send you a warning: the API is confusing, the documentation is vague, and every example you can find online will use deprecated/removed functionality somewhere.
Other than that, the existing options for encoding videos in D are pretty sparse. I would love to write some bindings to try and help the situation, but I’m not sure what libraries would be good. Are there any C/C++ libraries that developers prefer for video encoding, decoding, and manipulation?

August 26, 2024

On Thursday, 22 August 2024 at 14:01:50 UTC, IchorDev wrote:

>

On Monday, 19 August 2024 at 18:18:57 UTC, Ron Tarrant wrote:

>

[...]

If you know how to use ffmpeg as a library then there’s very good bindings in the form of ffmpeg-d. If you have never used ffmpeg as a library then I’ll send you a warning: the API is confusing, the documentation is vague, and every example you can find online will use deprecated/removed functionality somewhere.
Other than that, the existing options for encoding videos in D are pretty sparse. I would love to write some bindings to try and help the situation, but I’m not sure what libraries would be good. Are there any C/C++ libraries that developers prefer for video encoding, decoding, and manipulation?

Just to add that importC works pretty fine against ffmpeg, and it's a big plus as ffmpeg API is pretty fluid from release to release.

September 11

On Thursday, 22 August 2024 at 14:01:50 UTC, IchorDev wrote:

>

On Monday, 19 August 2024 at 18:18:57 UTC, Ron Tarrant wrote:

>

If you
have never used ffmpeg as a library then I’ll send you a warning: the API is confusing, the documentation is vague, and every example you can find online will use deprecated/removed functionality somewhere.

LOL! That's very comforting. :)

>

Other than that, the existing options for encoding videos in D are pretty sparse. I would love to write some bindings to try and help the situation, but I’m not sure what libraries would be good. Are there any C/C++ libraries that developers prefer for video encoding, decoding, and manipulation?

I saw an initial stab at creating OpenCV bindings, but it hasn't been touched in years. Perhaps that might be of interest?

September 11

On Wednesday, 11 September 2024 at 07:26:32 UTC, Ron Tarrant wrote:

>

On Thursday, 22 August 2024 at 14:01:50 UTC, IchorDev wrote:

>

On Monday, 19 August 2024 at 18:18:57 UTC, Ron Tarrant wrote:

> >

Are there any C/C++ libraries that developers prefer for video encoding, decoding, and manipulation?

I saw an initial stab at creating OpenCV bindings, but it hasn't been touched in years. Perhaps that might be of interest?

I suggest to go directly for ffmpeg usage, importC is pretty usable with that.
It's pretty low level, but it's the common engine for a bazar of external tools.

/P

September 11

On Monday, 19 August 2024 at 18:18:57 UTC, Ron Tarrant wrote:

>

Hi all,
Anyone know of a library similar to OpenCV that can be used from D to create MP4 files from a series of images? I think I came across some mention of OpenCV bindings, but I can't find it now.

Any help would be most welcome and appreciated. Thanks.

import std;

void main()
{

   // A mp4 1fps (-r 1) with standard settings
   auto pp = pipeShell("ffmpeg -y -r 1 -f png_pipe -c:v png -i - -c:v libx264 -crf 24 test.mp4", Redirect.all);

   // Feed frames from stdin
   pp.stdin.rawWrite(std.file.read("/path/to/your/frame1.png"));
   pp.stdin.rawWrite(std.file.read("/path/to/your/frame2.png"));
   pp.stdin.rawWrite(std.file.read("/path/to/your/frame3.png"));

   // Flush & close stdin
   pp.stdin.flush();
   pp.stdin.close();

   // Wait for ffmpeg to finish the job
   pp.pid.wait();
}

Andrea

September 12

On Wednesday, 11 September 2024 at 16:23:16 UTC, Andrea Fontana wrote:

>
import std;

void main()
{

   // A mp4 1fps (-r 1) with standard settings
   auto pp = pipeShell("ffmpeg -y -r 1 -f png_pipe -c:v png -i - -c:v libx264 -crf 24 test.mp4", Redirect.all);

   // Feed frames from stdin
   pp.stdin.rawWrite(std.file.read("/path/to/your/frame1.png"));
   pp.stdin.rawWrite(std.file.read("/path/to/your/frame2.png"));
   pp.stdin.rawWrite(std.file.read("/path/to/your/frame3.png"));

   // Flush & close stdin
   pp.stdin.flush();
   pp.stdin.close();

   // Wait for ffmpeg to finish the job
   pp.pid.wait();
}

Andrea

If you want to create a .y4m file without ffmpeg, here is old code (probably doesn't really build anymore):

« First   ‹ Prev
1 2