digitalmars.D - MP4 Library
- Ron Tarrant (5/5) Aug 19 Hi all,
- Jordan Wilson (7/13) Aug 19 dcv might be something you are interested in looking at.
- Ron Tarrant (2/4) Aug 20 Thanks, Jordan. I'll check those out.
- Elias Batek (3/4) Aug 21 By the way, there’s a wrapper for this exact purpose in arsd:
- IchorDev (13/19) Aug 22 If you know how to use ffmpeg as a library then there’s very good
- Paolo Invernizzi (4/18) Aug 26 Just to add that importC works pretty fine against ffmpeg, and
- Ron Tarrant (4/15) Sep 11 I saw an initial stab at creating OpenCV bindings, but it hasn't
- Paolo Invernizzi (7/13) Sep 11 I suggest to go directly for ffmpeg usage, importC is pretty
- IchorDev (5/9) Sep 20 Yes, rest assured: it sucks!
- Andrea Fontana (20/26) Sep 11 ```
- Guillaume Piolat (9/28) Sep 11 If you want to create a .y4m file without ffmpeg, here is old
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.
Aug 19
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
Aug 19
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` myselfThanks, Jordan. I'll check those out.
Aug 20
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
Aug 21
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](https://code.dlang.org/packages/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?
Aug 22
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: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.[...]If you know how to use ffmpeg as a library then there’s very good bindings in the form of [ffmpeg-d](https://code.dlang.org/packages/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?
Aug 26
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:LOL! That's very comforting. :)If youhave 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?I saw an initial stab at creating OpenCV bindings, but it hasn't been touched in years. Perhaps that might be of interest?
Sep 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: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. /PAre 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?
Sep 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: LOL! That's very comforting. :)Yes, rest assured: it sucks!I saw an initial stab at creating OpenCV bindings, but it hasn't been touched in years. Perhaps that might be of interest?Do people like OpenCV? I don't hear about it much. Also, were these bindings to the C or C++ API?
Sep 20
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
Sep 11
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(); } ``` AndreaIf you want to create a .y4m file without ffmpeg, here is old code (probably doesn't really build anymore): - https://github.com/p0nce/y4m-d let's you create a .y4m - https://github.com/p0nce/y4m-tools for manipulating such files - in particular, creating a YUV frame necessitate conversion from sRGB such as in https://github.com/p0nce/y4m-tools/blob/master/shader-capture/source/app.d#L359
Sep 11