Open SachinSAgrawal opened 1 year ago
The "\
As an example to run the program, if executing from the ascii_video-master directory:
build/ascii_video -v -c /Users/Sachin/Desktop/Rick Rolls/song240p.mp4
Or alternatively, if executing from the ascii_video-master/build directory
./ascii_video -v -c /Users/Sachin/Desktop/Rick Rolls/song240p.mp4
Thanks very much for the feedback, I'll be sure to make this clearer in the README.md as well by changing it to \
Thanks for getting back to me so fast! I had it working yesterday but then I did something and now when I run
mkdir build && cd build && cmake ../ && make -j2
, I get a long error message that is as follows:
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 2.8.12 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The C compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Curses: /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/lib/libcurses.tbd
-- Found PkgConfig: /opt/homebrew/bin/pkg-config (found version "0.29.2")
-- Checking for modules 'libavdevice;libavfilter;libavformat;libavcodec;libswresample;libswscale;libavutil'
-- Found libavdevice, version 59.7.100
-- Found libavfilter, version 8.44.100
-- Found libavformat, version 59.27.100
-- Found libavcodec, version 59.37.100
-- Found libswresample, version 4.7.100
-- Found libswscale, version 6.7.100
-- Found libavutil, version 57.28.100
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Sachin/Downloads/ascii_video-master/build
[ 7%] Building C object CMakeFiles/ascii_video.dir/src/ascii.c.o
[ 7%] Building C object CMakeFiles/ascii_video.dir/src/alloc.c.o
[ 15%] Building C object CMakeFiles/ascii_video.dir/src/audio.c.o
[ 15%] Building C object CMakeFiles/ascii_video.dir/src/boiler.c.o
/Users/Sachin/Downloads/ascii_video-master/src/boiler.c:188:25: error: no member named 'duration' in 'struct AVFrame'
resampledFrame->duration = original->duration;
~~~~~~~~~~~~~~ ^
/Users/Sachin/Downloads/ascii_video-master/src/boiler.c:188:46: error: no member named 'duration' in 'struct AVFrame'
resampledFrame->duration = original->duration;
~~~~~~~~ ^
/Users/Sachin/Downloads/ascii_video-master/src/boiler.c:208:24: error: no member named 'duration' in 'struct AVFrame'
resizedVideoFrame->duration = original->duration;
~~~~~~~~~~~~~~~~~ ^
/Users/Sachin/Downloads/ascii_video-master/src/boiler.c:208:45: error: no member named 'duration' in 'struct AVFrame'
resizedVideoFrame->duration = original->duration;
~~~~~~~~ ^
4 errors generated.
make[2]: *** [CMakeFiles/ascii_video.dir/src/boiler.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:30725:36: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddressDevices.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:30759:29: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:30801:29: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:30830:29: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:30885:29: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:30923:29: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:31013:29: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:31135:29: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:31173:29: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:31202:41: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddressDefaultDevice.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:32275:37: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:32305:37: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
In file included from /Users/Sachin/Downloads/ascii_video-master/src/audio.c:16:
/Users/Sachin/Downloads/ascii_video-master/./includes/miniaudio.h:32756:37: warning: 'kAudioObjectPropertyElementMaster' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
propAddress.mElement = kAudioObjectPropertyElementMaster;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementMain
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5: note: 'kAudioObjectPropertyElementMaster' has been explicitly marked deprecated here
kAudioObjectPropertyElementMaster API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain", macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0)) = kAudioObjectPropertyElementMain
^
13 warnings generated.
make[1]: *** [CMakeFiles/ascii_video.dir/all] Error 2
make: *** [all] Error 2
Sorry for the late reply, but I've been digging and testing for a while and I can't really figure out why it would build and then suddenly stop and claim that something "doesn't exist." FFmpeg is really a pain to work with in the first place but I hope it wouldn't just break like that. Do you mind me asking what you mean when you say "I did something"?
You're going to laugh at this, but when I ran mkdir build && cd build && cmake ../ && make -j2
, after getting the error message in the previous message, I would ran it again, and then move the CMakeLists.txt
file into build
, which seemingly made your code work because I got a message saying that text file was not found in the build
directory. Then I did not understand what you meant by executable
, which is why I created this thread, however, I now realize was wrong of me to do because the ascii_video
file never generated in the first place. My guess is that it is something on my end because I've had problems with FFmpeg before, so it might not be something wrong with your code. I would like to know why the executable is not shipped in the git repo, though, aka is it necessary for it to be generated locally?
Honestly, when I was making this project, it was my first time really working with C and C++ and I didn't really understand concepts like building C software, C libraries (especially FFmpeg’s licensing), and distributing packages for different OS's before diving into the code. That’s mainly the reason why it’s not the easiest to get the program working, so I’m truly sorry about that. Believe me, I’d much rather it be easier as well because it took me quite a while to learn how to build a third party library for the first time, especially when I didn't even get what commands like "cd" and "mkdir" were really doing or what a "current working directory" was.
It’s true that the project only depends on FFmpeg and Ncurses, but as far as I know (and correct me if I'm wrong please) there'd still have to be different executables generated for different OS's and architectures, as well as files and keys for package managers and whatnot. While I’m pretty sure this can be done easier with something like VirtualBox, it’s just something that I’m far from familiar with as of now.
Basically, it's just something that I haven't touched in or learned as of yet, trying to figure it out as I go. Right now, I'm focusing on trying to clean up the code as it’s quite verbose and difficult to read, and to move the codebase to C++ to depend on C++ 11 std::threads and FTXUI instead of pthreads and Ncurses, so that it can run on non-POSIX operating systems, but I’ll see what I can do about the ease of use for the current release.
I completely understand. Coding can definitely be tough sometimes, as I've been there myself plenty of times. Please don't feel any pressure to work on this because of me; I am sure there are alternatives. But I do think that you are right in terms of executables, package managers, etc definitely being different depending on the OS, but my guess is that they cannot be too different from each other. Thanks so much for all your help and timely responses!
I was looking into the errors I was getting, and it is definitely something on my end because it seems like some elements being used were deprecated. I would recommend putting in the readme
that your code cannot be run on Macs running MacOS 12.0 or later, or I would replace the deprecated elements with their updated ones if you feel like doing so.
Hello Coby, I found your ASCII video player, but I think that I am doing something wrong because I cannot run the executable. I just getting an error saying
zsh: no such file or directory: executable
. I am on a mac if this helps.