
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (23)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)
Sur d’autres sites (3970)
-
Capture JPEG frame from avi file using ffmpeg library. How to open captured files ?
30 novembre 2013, par ios198This is the code I found from the ffmpeg tutorial website :
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libswscale></libswscale>swscale.h>
#include
void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame) {
FILE *pFile;
char szFilename[32];
int y;
// Open file
sprintf(szFilename, "frame%d.ppm", iFrame); // szFilenam = frame4.ppm
pFile=fopen(szFilename, "wb");
if (pFile == NULL) {
return;
}
//Write header
fprintf(pFile, "P6\n%d %d\n255\n", width, height);
// Write pixel data
for(y=0; ydata[0]+y*pFrame->linesize[0], 1, width*3, pFile);
// Close file
fclose(pFile);
}
int main(int argc, char **argv[])
{
AVFormatContext *pFormatCtx = NULL;
int i, videoStream;
AVCodecContext *pCodecCtx = NULL;
AVCodec *pCodec = NULL;
AVFrame *pFrame = NULL;
AVFrame *pFrameRGB = NULL;
AVPacket packet;
int frameFinished;
int numBytes;
uint8_t *buffer = NULL;
AVDictionary *optionsDict = NULL;
struct SwsContext *sws_ctx = NULL;
// Register all formats and codecs
av_register_all();
// Open video file
if(avformat_open_input(&pFormatCtx, "/root/dhquan/AVI/turning_pages.avi", NULL, NULL)!=0)
return -1; // couldn't open file
// Retrieve stream information
if(avformat_find_stream_info(pFormatCtx,NULL)<0)
return -1; // couldn't find stream information
// This function populates pFormatCtx->streams with the proper
// dump information about file onto standard error
av_dump_format(pFormatCtx, 0, "/root/dhquan/AVI/turning_pages.avi", 0);
// Find the first video stream
videoStream = -1;
for(i=0;inb_streams;i++)
if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO){
videoStream=i;
break;
}
if(videoStream==-1)
return -1; // didn't find a video stream
// Get a pointer to the codec context for the video stream
pCodecCtx= pFormatCtx->streams[videoStream]->codec;
// Find the decoder for the video stream
pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
if(pCodec==NULL){
fprintf(stderr,"Unsupported codec!\n");
return -1;
}
// Open Codec
if(avcodec_open2(pCodecCtx, pCodec, &optionsDict)<0)
return -1; // Could not open codec
// Allocate video frame
pFrame = avcodec_alloc_frame();
// Allocate an AVFrame structure
pFrameRGB=avcodec_alloc_frame();
if(pFrameRGB==NULL)
return -1;
// Determine required buffer size and allocate buffer
numBytes=avpicture_get_size(PIX_FMT_RGB24, pCodecCtx->width,
pCodecCtx->height);
buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));
sws_ctx =
sws_getContext
(
pCodecCtx->width,
pCodecCtx->height,
pCodecCtx->pix_fmt,
pCodecCtx->width,
pCodecCtx->height,
PIX_FMT_RGB24,
SWS_BILINEAR,
NULL,
NULL,
NULL
);
// Assign appropriate parts of buffer to image planes in pFrameRGB
// Note that pFrameRGB is an AVFrame, but AVFrame is a superset
// of AVPicture
avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24,
pCodecCtx->width, pCodecCtx->height);
// Read frames and save first five frames to disk
i=0;
while(av_read_frame(pFormatCtx, &packet)>=0) {
// Is this a packet from the video stream?
if(packet.stream_index==videoStream) {
// Decode video frame
avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished,
&packet);
// Did we get a video frame?
if(frameFinished) {
// Convert the image from its native format to RGB
sws_scale
(
sws_ctx,
(uint8_t const * const *)pFrame->data,
pFrame->linesize,
0,
pCodecCtx->height,
pFrameRGB->data,
pFrameRGB->linesize
);
// Save the frame to disk
if(++i<=5)
SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height,
i);
}
}
// Free the packet that was allocated by av_read_frame
av_free_packet(&packet);
}
// Free the RGB image
av_free(buffer);
av_free(pFrameRGB);
// Free the YUV frame
av_free(pFrame);
// Close the codec
avcodec_close(pCodecCtx);
// Close the video file
avformat_close_input(&pFormatCtx);
return 0;
//getch();
}In line :
sprintf(szFilename, "frame%d.ppm", iFrame) ;I changed into frame%d.jpg. It creates .jpg file in my folder. But I can't read it. How to open this file ? Please help me.
-
Could not find codec parameters for stream 0 (Video : hevc, none) : unspecified size
5 avril 2020, par bzc0fqI try to use ffmpeg to feed ffserver on CENTOS 6.10. When I run ffmpeg on stream I got an error message : Could not find codec parameters for stream 0 (Video : h264, none) : unspecified size.



The full ffmpeg output is here :



[root@stone1 ~]# ffmpeg -i rtsp://user44:xxx@192.168.101.108:554/0 -y http://192.168.101.1:8090/feed2.ffm
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
 built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
 configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libdc1394 --enable-libfaac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
 libavutil 54. 20.100 / 54. 20.100
 libavcodec 56. 26.100 / 56. 26.100
 libavformat 56. 25.101 / 56. 25.101
 libavdevice 56. 4.100 / 56. 4.100
 libavfilter 5. 11.102 / 5. 11.102
 libavresample 2. 1. 0 / 2. 1. 0
 libswscale 3. 1.101 / 3. 1.101
 libswresample 1. 1.100 / 1. 1.100
 libpostproc 53. 3.100 / 53. 3.100
[rtsp @ 0x8bc780] Could not find codec parameters for stream 0 (Video: hevc, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://user44:xxx@192.168.101.108:554/0':
 Metadata:
 title : h264.mp4
 Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: hevc, none, 90k tbr, 90k tbn, 90k tbc
 Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s
[buffer @ 0x91c2e0] Unable to parse option value "0x0" as image size
[buffer @ 0x91c2e0] Unable to parse option value "-1" as pixel format
[buffer @ 0x91c2e0] Unable to parse option value "0x0" as image size
[buffer @ 0x91c2e0] Error setting option video_size to value 0x0.
[graph 0 input from stream 0:0 @ 0x8a0da0] Error applying options to the filter.
Error opening filters!




I tested the stream with vlc on windows and it looks it works fine.




Any hints on the issue ?





UPDATE



I have confirmed that the same issue remains on Windows and Linux ffmpeg ver. 4.2.2. Please find attached debug output bellow.



D:\Temp\ffmpeg-4.2.2-win64-static\bin>ffmpeg -loglevel debug -i rtsp://userxx:xxx@192.168.101.108:554/0:0 -y http://192.168.101.1:8090/feed2.ffm
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 9.2.1 (GCC) 20200122
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input url with argument 'rtsp://userxx:xxx@192.168.101.108:554/0:0'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'http://192.168.101.1:8090/feed2.ffm' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://userxx:xxx@192.168.101.108:554/0:0.
Successfully parsed a group of options.
Opening an input file: rtsp://userxx:xxx@192.168.101.108:554/0:0.
[tcp @ 000002426835b540] No default whitelist set
[tcp @ 000002426835b540] Original list of addresses:
[tcp @ 000002426835b540] Address 192.168.101.108 port 554
[tcp @ 000002426835b540] Interleaved list of addresses:
[tcp @ 000002426835b540] Address 192.168.101.108 port 554
[tcp @ 000002426835b540] Starting connection attempt to 192.168.101.108 port 554
[tcp @ 000002426835b540] Successfully connected to 192.168.101.108 port 554
[rtsp @ 0000024268358c40] SDP:
v=0
o=StreamingServer 3331435948 1116907222000 IN IP4 192.168.101.108
s=h264.mp4
c=IN IP4 0.0.0.0
t=0 0
a=control:*
m=video 0 RTP/AVP 96
a=control:trackID=0
a=rtpmap:96 H265/90000
a=ptime:40
a=range:npt=0-0
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=(null)
a=videoinfo:960*576*30*4096
m=audio 0 RTP/AVP 0
a=control:trackID=1
a=rtpmap:0 PCMU/8000
a=ptime:20


[rtsp @ 0000024268358c40] video codec set to: hevc
[rtsp @ 0000024268358c40] audio codec set to: pcm_mulaw
[rtsp @ 0000024268358c40] audio samplerate set to: 8000
[rtsp @ 0000024268358c40] audio channels set to: 1
[rtp @ 000002426835bb00] No default whitelist set
[udp @ 000002426835f600] No default whitelist set
[udp @ 000002426835f600] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 000002426835f600] end receive buffer size reported is 65536
[udp @ 000002426836f900] No default whitelist set
[udp @ 000002426836f900] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 000002426836f900] end receive buffer size reported is 65536
[rtsp @ 0000024268358c40] setting jitter buffer size to 500
[rtp @ 00000242683804c0] No default whitelist set
[udp @ 0000024268380780] No default whitelist set
[udp @ 0000024268380780] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 0000024268380780] end receive buffer size reported is 65536
[udp @ 0000024268390a80] No default whitelist set
[udp @ 0000024268390a80] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 0000024268390a80] end receive buffer size reported is 65536
[rtsp @ 0000024268358c40] setting jitter buffer size to 500
[rtsp @ 0000024268358c40] hello state=0
[rtsp @ 0000024268358c40] Could not find codec parameters for stream 0 (Video: hevc, 1 reference frame, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://userxx:xxx@192.168.101.108:554/0:0':
 Metadata:
 title : h264.mp4
 Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
 Stream #0:0, 0, 1/90000: Video: hevc, 1 reference frame, none, 90k tbr, 90k tbn, 90k tbc
 Stream #0:1, 0, 1/8000: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
Successfully opened the file.
Parsing a group of options: output url http://192.168.101.1:8090/feed2.ffm.
Successfully parsed a group of options.
Opening an output file: http://192.168.101.1:8090/feed2.ffm.
[NULL @ 00000242683c85c0] Unable to find a suitable output format for 'http://192.168.101.1:8090/feed2.ffm'
http://192.168.101.1:8090/feed2.ffm: Invalid argument




VLC works fine on the same Windows system.



Any hints on this please ?


-
cmake installation of x265 for ffmpeg on Cygwin - executable location different from other codecs
12 mai 2020, par bballdave025TL ;DR (with expected vs. real)



For a Cygwin build of
ffmpeg
, I'm installingx265
, and it seems to me that the executable ends up in the wrong place. I'll show some basic directory structure, then I'll show thetree
outputs for expected and real, both before and after thecmake
installation. For directories where I think this is important, I'll show the outputs before and after thecmake
installation.


My question has two parts. I used the following
cmake
andmake
commands,


# pwd => $HOME/programs/ffmpeg/ffmpeg_sources/x265/build/linux
PATH="$HOME/programs/ffmpeg/bin:$PATH" \
 cmake -G "Unix Makefiles" \
 -DCMAKE_INSTALL_PREFIX="$HOME/programs/ffmpeg/ffmpeg_build" \
 -DENABLE_SHARED=OFF \
 -DCMAKE_EXE_LINKER_FLAGS="-static" 
 ../../source
PATH="$HOME/programs/ffmpeg/bin:$PATH" make -j $(nproc)
make install




The result is below, with my real vs. expected, and there is a more detailed, more explicit, and hopefully more clear file with the info at pastebin.com/86wHrtxR. Now, for my two-part question :



- 

-
How can I change my
cmake
command so that myx265.exe
file ends up in$HOME/programs/ffmpeg/bin
with the proper linking, rather than$HOME/programs/ffmpeg/ffmpeg_build/bin
? -
Would the build/linker/whatever figure things out for the
ffmpeg
build ?







I want to know the answer to question number 1 regardless of the answer to question number 2. I haven't used
cmake
with the-DVAR=var
flags before, and I'd like to take this opportunity to learn.


For the result :



Things surrounded by double curly brackets are
{{ expected }}
.


Things surrounded by double angle brackets are
<< real >>
, i.e. they exist after the installation is done.


If real matches expected, and the file/directory is new, I've surrounded it by double parentheses, i.e. double round brackets.
(( match ))



If something is not new (and thus has the same before and after) I haven't marked it.



me@MACHINE ~/programs/ffmpeg
 $ tree --charset=ascii bin
 bin
 |-- lame.exe
 |-- mp3rtp.exe
 |-- mp3x.exe
 `-- x264.exe
{{ `-- x265.exe }} ## Expected, not Exists

 me@MACHINE ~/programs/ffmpeg
 $ tree --charset=ascii \
 ffmpeg_build
 ffmpeg_build
<< |-- bin >> ## Not expected, Exists
<< | `-- x265.exe >> ## Not expected, Exists
 |-- include
 | |-- fdk-aac
 | | |-- aacdecoder_lib.h
 | | |-- aacenc_lib.h
 | | `-- ... <more files="files">
 | |-- lame
 | | `-- lame.h
 | |-- x264.h
 | `-- x264_config.h
(( | |-- x265.h )) ## Expected and Exists
(( | `-- x265_config.h )) ## Expected and Exists
 |-- lib
 | |-- libfdk-aac.a
 | |-- libfdk-aac.la
 | |-- libmp3lame.a
 | |-- libmp3lame.la
(( | |-- libx265.a )) ## Expected and Exists
 | `-- pkgconfig
 | |-- fdk-aac.pc
 | `-- x264.pc
(( | `-- x265.pc )) ## Expected and Exists
 `-- share
 |-- doc
 | ... <only lame="lame">
 `-- man
 ... <only lame="lame">
</only></only></more>



Other, possibly useful information about the build directory structure.



me@MACHINE ~/programs/ffmpeg
$ tree --charset=ascii -L 1 .
.
|-- bin
|-- ffmpeg_build
`-- ffmpeg_sources

3 directories, 0 files




For this next,
ffmpeg_sources
dir, I'm showing the after (which is both expected and real/exists) surrounded by double parentheses, i.e. double round brackets,(( <after> ))</after>
.


me@MACHINE ~/programs/ffmpeg
 $ tree --charset=ascii -L 1 ffmpeg_sources
 ffmpeg_sources
 |-- fdk-aac.zip
 |-- lame-svn
 |-- mstorsjo-fdk-aac-e7d8591
 |-- x264-snapshot-20191217-2245
 |-- x264-snapshot-20191217-2245.tar.bz2
 `-- x264-snapshot-20191218-README.txt
(( `-- x265 ))

 3 directories, 3 files
(( 4 directories, 3 files ))






NOW, FOR SOME MORE DETAIL





What I'm Doing



I am working on a Cygwin build (vs. a Windows/mingw build) of
ffmpeg
. I am following an older guide by koohiimaster (archived). That guide says,




[W]e are not cross-compiling for windows ; we are compiling for Cygwin.





This 2014 guide doesn't have all of the codecs I want - I want as complete a build as possible - so I've also been referring to this ffmpeg-for-Ubuntu guide (archived), which I hope is kept up-to-date. It's referred to by koohiimaster.



Also, as a way of checking that I'm getting all the codecs I want, I've been looking at this FFmpeg for Windows guide from SuperUser



I'll give the basics of my steps below. More details, as well as all the output is at pastebin.com/suL1nU6Z.



A look at directory structure for the build



me@MACHINE ~/programs/ffmpeg
$ cd $HOME/programs/ffmpeg

me@MACHINE ~/programs/ffmpeg
$ tree --charset=ascii -d -L 1
.
|-- bin
|-- ffmpeg_build
`-- ffmpeg_sources

3 directories




Getting the source. Note that I had to
apt-cyg install mercurial
, though (with my Cygwin setup GUI/EXE in my Cygwin root directory, i.e.C:\cygwin64\setup-x86_64.exe
), I could also have done/setup-x86_64.exe install -q -P mercurial
.


cd ffmpeg_sources
hg clone https://bitbucket.org/multicoreware/x265




Running the
cmake
andmake
commands


cd x265/build/linux
PATH="$HOME/programs/ffmpeg/bin:$PATH" \
 cmake -G "Unix Makefiles" \
 -DCMAKE_INSTALL_PREFIX="$HOME/programs/ffmpeg/ffmpeg_build" \
 -DENABLE_SHARED=OFF \
 -DCMAKE_EXE_LINKER_FLAGS="-static" \
 ../../source
PATH="$HOME/programs/ffmpeg/bin:$PATH" make -j $(nproc)
make install




It was the last part (actually the very last line) of the
make install
output that worried me. Here is the whole output - it's not very long.


make[1]: Entering directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
make[2]: Entering directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
make[2]: Leaving directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
[ 20%] Built target encoder
make[2]: Entering directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
make[2]: Leaving directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
[ 83%] Built target common
make[2]: Entering directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
make[2]: Leaving directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
[ 84%] Built target x265-static
make[2]: Entering directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
make[2]: Leaving directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
[100%] Built target cli
make[1]: Leaving directory '/home/me/programs/ffmpeg/ffmpeg_sources/x265/build/linux'
Install the project...
-- Install configuration: "Release"
-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/lib/libx265.a
-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/include/x265.h
-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/include/x265_config.h
-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/lib/pkgconfig/x265.pc
-- Installing: /home/me/programs/ffmpeg/ffmpeg_build/bin/x265.exe




As discussed in the TL ;DR section, I expected to see
x265.exe
at


home/me/programs/ffmpeg/bin/x265.exe



rather than the path given on the last line of output,



/home/me/programs/ffmpeg/ffmpeg_build/bin/x265.exe



This worries me especially because the first part of the
ffmpeg
install command that my instructions inform me to run is


PATH="$HOME/programs/ffmpeg/bin:$PATH" \
PKG_CONFIG_PATH="$HOME/programs/ffmpeg/ffmpeg_build/lib/pkgconfig" \
 ./configure \
 --prefix="$HOME/programs/ffmpeg/ffmpeg_build" \
 --extra-cflags="-I$HOME/programs/ffmpeg/ffmpeg_build/include" \
 --extra-ldflags="-L$HOME/programs/ffmpeg/ffmpeg_build/lib" \
 --bindir="$HOME/programs/ffmpeg/bin" \




... and on it goes ...



It would seem to me that the
.configure
script forffmpeg
won't find thex265
executable, since it's not in thebindir
.


I'll repeat my two-part question from before :



- 

- How can I change my
cmake
command so that myx265.exe
file ends up in$HOME/programs/ffmpeg/bin
with the proper linking, rather than$HOME/programs/ffmpeg/ffmpeg_build/bin
?





What I'm looking for here is something akin to the
--bindir
flag frommake
's./confiure
.


- 

- Would the build/linker/whatever figure things out for the
ffmpeg
build ?





I want to know the answer to question number 1 regardless of the answer to question number 2. I haven't used
cmake
with the-DVAR=var
flags before, and I'd like to take this opportunity to learn.




Where I've Looked & What I've Tried



I first started with the
man
page and the--help
forcmake
. That was scary. I was hoping that I'd find something useful around theCMAKE_INSTALL_PREFIX
stuff, but I wasn't sure what to make of it.


I tried
grep
ing throughcmake --help-full
(with 50 lines before and after whatever I was searching for), but got tripped up by the complexity. I've only used basiccmake
stuff, before, and I got more than a little lost.


Even with the
--help
, I don't know if I need to look at thehelp-manual
, thehelp-command
, thehelp-module
, thehelp-policy
, thehelp-variable
, or something else.


It seemed to me, in reading, that a "binary directory" is the top of the "build", whereas I thought it would be the dir named
bin
... I couldn't tell what things were meant to be used by the person creating the package rather than by me, who am trying to make/build the package from the command line.


I looked through what seemed to be a
cmake
wiki's Useful Variables page (archived), as well as at this thread at cmake.org (archived), which, along with this SO source and this and this and this and this SO sources, seemed to suggest using theCMAKE_RUNTIME_OUTPUT_DIRECTORY
variable (since theEXECUTABLE_OUTPUT-DIRECTORY
variable has been superseded by it). By the way, I couldn't tell which things should be used by the creator of the package vs. the consumer of the package - the consumer being me. I tried with


PATH="$HOME/programs/ffmpeg/bin:$PATH" \
 cmake -G "Unix Makefiles" \
 -DCMAKE_INSTALL_PREFIX="$HOME/programs/ffmpeg/ffmpeg_build" \
 -DCMAKE_RUNTIME_OUTPUT_DIRECTORY="$HOME/programs/ffmpeg/bin" \
 -DENABLE_SHARED=OFF \
 -DCMAKE_EXE_LINKER_FLAGS="-static" 
 ../../source
PATH="$HOME/




and have thought about fifty-or-so other -DVAR variables, but with any I have tried, I still get the same result. I still get the executable in what seems to be the wrong place.





System Details



$ date && date +'%s'
Tue, May 5, 2020 11:14:40 AM
1588698880
$ uname -a
CYGWIN_NT-10.0 MACHINE 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin
$ cmake --version
cmake version 3.14.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ bash --version | head -n 1
GNU bash, version 4.4.12(3)-release (x86_64-unknown-cygwin)
$ gcc --version | head -n 1
gcc (GCC) 9.3.0
$ g++ --version | head -n 1
g++ (GCC) 9.3.0
$ make --version | head -n 2
GNU Make 4.3
Built for x86_64-pc-cygwin



-