
Recherche avancée
Médias (91)
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#1 The Wires
11 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (27)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...) -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...)
Sur d’autres sites (5245)
-
"FFmpeg : Error not transitioning to the next song in Discord Bot's queue."
1er avril 2024, par nooberI have 3 modules, but I'm sure the error occurs within this module, and here is the entire code within that module :


import asyncio
import discord
from discord import FFmpegOpusAudio, Embed
import os

async def handle_help(message):
 embed = discord.Embed(
 title="Danh sách lệnh cho Bé Mèo",
 description="Dưới đây là các lệnh mà chủ nhân có thể bắt Bé Mèo phục vụ:",
 color=discord.Color.blue()
 )
 embed.add_field(name="!play", value="Phát một bài hát từ YouTube.", inline=False)
 embed.add_field(name="!pause", value="Tạm dừng bài hát đang phát.", inline=False)
 embed.add_field(name="!resume", value="Tiếp tục bài hát đang bị tạm dừng.", inline=False)
 embed.add_field(name="!skip", value="Chuyển đến bài hát tiếp theo trong danh sách chờ.", inline=False)
 embed.add_field(name="!stop", value="Dừng phát nhạc và cho phép Bé Mèo đi ngủ tiếp.", inline=False)
 # Thêm các lệnh khác theo cùng mẫu trên
 await message.channel.send(embed=embed)

class Song:
 def __init__(self, title, player):
 self.title = title # Lưu trữ tiêu đề bài hát ở đây
 self.player = player

# Thêm đối tượng Song vào hàng đợi
def add_song_to_queue(guild_id, queues, song):
 queues.setdefault(guild_id, []).append(song)

async def handle_list(message, queues):
 log_file_path = "C:\\Bot Music 2\\song_log.txt"
 if os.path.exists(log_file_path):
 with open(log_file_path, "r", encoding="utf-8") as f:
 song_list = f.readlines()

 if song_list:
 embed = discord.Embed(
 title="Danh sách bài hát",
 description="Danh sách các bài hát đã phát:",
 color=discord.Color.blue()
 )

 for i, song in enumerate(song_list, start=1):
 if i == 1:
 song = "- Đang phát: " + song.strip()
 embed.add_field(name=f"Bài hát {i}", value=song, inline=False)

 await message.channel.send(embed=embed)
 else:
 await message.channel.send("Hiện không có dữ liệu trong file log.")
 else:
 await message.channel.send("File log không tồn tại.")

async def handle_commands(message, client, queues, voice_clients, yt_dl_options, ytdl, ffmpeg_options=None, guild_id=None, data=None):
 # Nếu không có ffmpeg_options, sử dụng các thiết lập mặc định
 if ffmpeg_options is None:
 ffmpeg_options = {
 'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
 'options': '-vn -filter:a "volume=0.25"'
 }
 
 # Khởi tạo voice_client
 if guild_id is None:
 guild_id = message.guild.id

 if guild_id in voice_clients:
 voice_client = voice_clients[guild_id]
 else:
 voice_client = None

 # Xử lý lệnh !play
 if message.content.startswith("!play"):
 try:
 # Kiểm tra xem người gửi tin nhắn có đang ở trong kênh voice không
 voice_channel = message.author.voice.channel
 # Kiểm tra xem bot có đang ở trong kênh voice của guild không
 if voice_client and voice_client.is_connected():
 await voice_client.move_to(voice_channel)
 else:
 voice_client = await voice_channel.connect()
 voice_clients[guild_id] = voice_client
 except Exception as e:
 print(e)

 try:
 query = ' '.join(message.content.split()[1:])
 if query.startswith('http'):
 url = query
 else:
 query = 'ytsearch:' + query
 loop = asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(query, download=False))
 if not data:
 raise ValueError("Không có dữ liệu trả về từ YouTube.")
 url = data['entries'][0]['url']

 player = FFmpegOpusAudio(url, **ffmpeg_options)
 # Lấy thông tin của bài hát mới đang được yêu cầu
 title = data['entries'][0]['title']
 duration = data['entries'][0]['duration']
 creator = data['entries'][0]['creator'] if 'creator' in data['entries'][0] else "Unknown"
 requester = message.author.nick if message.author.nick else message.author.name
 
 # Tạo embed để thông báo thông tin bài hát mới
 embed = discord.Embed(
 title="Thông tin bài hát mới",
 description=f"**Bài hát:** *{title}*\n**Thời lượng:** *{duration}*\n**Tác giả:** *{creator}*\n**Người yêu cầu:** *{requester}*",
 color=discord.Color.green()
 )
 await message.channel.send(embed=embed)
 
 # Sau khi lấy thông tin của bài hát diễn ra, gọi hàm log_song_title với title của bài hát
 # Ví dụ:
 title = data['entries'][0]['title']
 await log_song_title(title)

 # Thêm vào danh sách chờ nếu có bài hát đang phát
 if voice_client.is_playing():
 queues.setdefault(guild_id, []).append(player)
 else:
 voice_client.play(player)
 
 except Exception as e:
 print(e)
 
 if message.content.startswith("!link"):
 try:
 voice_client = await message.author.voice.channel.connect()
 voice_clients[voice_client.guild.id] = voice_client
 except Exception as e:
 print(e)

 try:
 url = message.content.split()[1]

 loop = asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=False))

 song = data['url']
 player = discord.FFmpegOpusAudio(song, **ffmpeg_options)

 voice_clients[message.guild.id].play(player)
 except Exception as e:
 print(e)

 # Xử lý lệnh !queue
 elif message.content.startswith("!queue"):
 queue = queues.get(guild_id, [])
 if queue:
 await message.channel.send("Danh sách chờ:")
 for index, item in enumerate(queue, 1):
 await message.channel.send(f"{index}. {item.title}")
 else:
 await message.channel.send("Không có bài hát nào trong danh sách chờ.")

 # Xử lý lệnh !skip
 elif message.content.startswith("!skip"):
 try:
 if voice_client and voice_client.is_playing():
 voice_client.stop()
 await play_next_song(guild_id, queues, voice_client, skip=True)
 await remove_first_line_from_log()
 except Exception as e:
 print(e)

 # Xử lý các lệnh như !pause, !resume, !stop
 elif message.content.startswith("!pause"):
 try:
 if voice_client and voice_client.is_playing():
 voice_client.pause()
 except Exception as e:
 print(e)

 elif message.content.startswith("!resume"):
 try:
 if voice_client and not voice_client.is_playing():
 voice_client.resume()
 except Exception as e:
 print(e)

 elif message.content.startswith("!stop"):
 try:
 if voice_client:
 voice_client.stop()
 await voice_client.disconnect()
 del voice_clients[guild_id] # Xóa voice_client sau khi dừng
 except Exception as e:
 print(e)

async def log_song_title(title):
 log_file_path = "C:\\Bot Music 2\\song_log.txt"
 try:
 # Kiểm tra xem tệp tin log đã tồn tại chưa
 if not os.path.exists(log_file_path):
 # Nếu chưa tồn tại, tạo tệp tin mới và ghi title vào tệp tin đó
 with open(log_file_path, 'w', encoding='utf-8') as file:
 file.write(title + '\n')
 else:
 # Nếu tệp tin log đã tồn tại, mở tệp tin và chèn title vào cuối tệp tin
 with open(log_file_path, 'a', encoding='utf-8') as file:
 file.write(title + '\n')
 except Exception as e:
 print(f"Error logging song title: {e}")

async def remove_first_line_from_log():
 log_file_path = "C:\\Bot Music 2\\song_log.txt"
 try:
 with open(log_file_path, "r", encoding="utf-8") as f:
 lines = f.readlines()
 # Xóa dòng đầu tiên trong list lines
 lines = lines[1:]
 with open(log_file_path, "w", encoding="utf-8") as f:
 for line in lines:
 f.write(line)
 except Exception as e:
 print(f"Error removing first line from log: {e}")
 
async def clear_log_file():
 log_file_path = "C:\\Bot Music 2\\song_log.txt"
 try:
 with open(log_file_path, "w", encoding="utf-8") as f:
 f.truncate(0)
 except Exception as e:
 print(f"Error clearing log file: {e}")


async def play_next_song(guild_id, queues, voice_client, skip=False):
 queue = queues.get(guild_id, [])
 if queue:
 player = queue.pop(0)
 voice_client.play(player, after=lambda e: asyncio.run_coroutine_threadsafe(play_next_song(guild_id, queues, voice_client, skip=False), voice_client.loop))
 if skip:
 return
 else:
 await remove_first_line_from_log() # Xóa dòng đầu tiên trong file log
 elif skip:
 await remove_first_line_from_log() # Xóa dòng đầu tiên trong file log
 await voice_client.disconnect()
 del voice_client[guild_id] # Xóa voice_client sau khi dừng
 else:
 await clear_log_file() # Xóa dòng đầu tiên trong file log
 await voice_client.disconnect()
 del voice_client[guild_id] # Xóa voice_client sau khi dừng



I have tried asking ChatGPT, Gemini, or Bing, and they always lead me into a loop of errors that cannot be resolved. This error only occurs when the song naturally finishes playing due to its duration. If the song is playing and I use the command !skip, the next song in the queue will play and function normally. I noticed that it seems like if a song ends naturally, the song queue is also cleared immediately. I hope someone can help me with this


-
"undefined reference to av···@···"ffmpeg error,when i cross compile opencv4.5.3 which include ffmpeg lib
11 mai 2024, par caiping Pengeveryone,It is sorry to bother you,but i need some help.
I'm working on an embedded deployment project,doing object detection work to real-time video stream. So I have to port my c++ inference prog to RKNN1808 platform. I compile this program with CMake tool,but I cant finish my work because opencv lib cant be compiled rightly.
To FFmpeg,my configure commend is following :


./configure --enable-cross-compile --cross-prefix=/home/midsummer/Tool/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- --target-os=linux --arch=aarch64 --prefix=/usr/local/ffmpeg --enable-shared



then I am gonna show you the ffmpeg version :


libavutil 56. 70.100
libavcodec 58.134.100
libavformat 58. 76.100
libavdevice 58. 13.100
libavfilter 7.110.100
libswscale 5. 9.100
libswresample 3. 9.100
libpostproc 55. 9.100



next ,I use following commend to build cmake project :


cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_C_COMPILER=/home/midsummer/Tool/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc -D CMAKE_CXX_COMPILER=/home/midsummer/Tool/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++ -D BUILD_SHARED_LIBS=ON -D CMAKE_CXX_FLAGS=-fPIC -D CMAKE_C_FLAGS=-fPIC -D CMAKE_EXE_LINKER_FLAGS=-lpthread -ldl -D ENABLE_PIC=ON -D WITH_1394=OFF -D WITH_ARAVIS=OFF -D WITH_ARITH_DEC=ON -D WITH_ARITH_ENC=ON -D WITH_CLP=OFF -D WITH_CUBLAS=OFF -D WITH_CUDA=OFF -D WITH_CUFFT=OFF -D WITH_FFMPEG=ON -D WITH_GSTREAMER=ON -D WITH_GSTREAMER_0_10=OFF -D WITH_HALIDE=OFF -D WITH_HPX=OFF -D WITH_IMGCODEC_HDR=ON -D WITH_IMGCODEC_PXM=ON -D WITH_IMGCODEC_SUNRASTER=ON -D WITH_INF_ENGINE=OFF -D WITH_IPP=OFF -D WITH_ITT=OFF -D WITH_JASPER=ON -D WITH_JPEG=ON -D WITH_LAPACK=ON -D WITH_LIBREALSENSE=OFF -D WITH_NVCUVID=OFF -D WITH_OPENCL=OFF -D WITH_OPENCLAMDBLAS=OFF -D WITH_OPENCLAMDFFT=OFF -D WITH_OPENCL_SVM=OFF -D WITH_OPENEXR=OFF -D WITH_OPENGL=OFF -D WITH_OPENMP=OFF -D WITH_OPENNNI=OFF -D WITH_OPENNNI2=OFF -D WITH_OPENVX=OFF -D WITH_PNG=OFF -D WITH_PROTOBUF=OFF -D WITH_PTHREADS_PF=ON -D WITH_PVAPI=OFF -D WITH_QT=OFF -D WITH_QUIRC=OFF -D WITH_TBB=OFF -D WITH_TIFF=ON -D WITH_VULKAN=OFF -D WITH_WEBP=ON -D WITH_XIMEA=OFF -D CMAKE_INSTALL_PREFIX=../CrossCompileResult -D WITH_GTK=OFF -D BUILD_opencv_dnn=OFF ..



following is the outpt about FFmpeg :


-- Video I/O:
-- FFMPEG: YES
-- avcodec: YES (58.134.100)
-- avformat: YES (58.76.100)
-- avutil: YES (56.70.100)
-- swscale: YES (5.9.100)
-- avresample: NO
-- GStreamer: NO
-- v4l/v4l2: YES (linux/videodev2.h)




After building the cmake project,I compiled this project with comment 【make -j16】.After not so long time,I got the Error :


[ 49%] Linking CXX executable ../../bin/opencv_annotation
[ 49%] Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/ts_tags.cpp.o
[ 49%] Built target opencv_annotation
[ 49%] Linking CXX executable ../../bin/opencv_visualisation
/home/midsummer/Tool/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.3.1/../../../../aarch64-linux-gnu/bin/ld: warning: libavcodec.so.58, needed by ../../lib/libopencv_videoio.so.4.5.3, not found (try using -rpath or -rpath-link)
/home/midsummer/Tool/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.3.1/../../../../aarch64-linux-gnu/bin/ld: warning: libavformat.so.58, needed by ../../lib/libopencv_videoio.so.4.5.3, not found (try using -rpath or -rpath-link)
/home/midsummer/Tool/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.3.1/../../../../aarch64-linux-gnu/bin/ld: warning: libavutil.so.56, needed by ../../lib/libopencv_videoio.so.4.5.3, not found (try using -rpath or -rpath-link)
/home/midsummer/Tool/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.3.1/../../../../aarch64-linux-gnu/bin/ld: warning: libswscale.so.5, needed by ../../lib/libopencv_videoio.so.4.5.3, not found (try using -rpath or -rpath-link)
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_init_packet@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_get_riff_video_tags@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_send_packet@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_receive_packet@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_get_mov_video_tags@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_find_decoder@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_find_decoder_by_name@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_frame_alloc@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_get_name@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwframe_transfer_data@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_malloc@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avio_open@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_alloc_context@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_sub_q@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_network_init@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_packet_free@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_flush_buffers@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_find_encoder@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `sws_getContext@LIBSWSCALE_5'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_receive_frame@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_write_frame@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_close_input@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_seek_frame@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `sws_freeContext@LIBSWSCALE_5'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_dict_set@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_descriptor_get_by_name@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `sws_scale@LIBSWSCALE_5'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_packet_unref@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_dict_parse_string@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_frame_get_buffer@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_freep@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_find_stream_info@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_read_frame@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_free_context@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_default_get_format@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwframe_ctx_init@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_register_all@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_free@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwframe_get_buffer@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_guess_sample_aspect_ratio@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_new_stream@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwframe_constraints_free@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwdevice_ctx_create_derived@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_frame_unref@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_buffer_unref@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_write_trailer@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_packet_rescale_ts@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_bsf_get_by_name@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_send_frame@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_get_hw_config@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_buffer_ref@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_dict_get@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_bsf_free@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_codec_is_decoder@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_open_input@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_lockmgr_register@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_packet_alloc@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwframe_ctx_create_derived@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_bsf_send_packet@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_bsf_alloc@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_log_set_level@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_image_get_buffer_size@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_open2@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_codec_is_encoder@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_guess_format@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_image_fill_arrays@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_bsf_receive_packet@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `sws_getCachedContext@LIBSWSCALE_5'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_codec_get_tag@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwdevice_get_hwframe_constraints@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwdevice_ctx_create@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_codec_iterate@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_log_set_callback@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_opt_set@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_codec_get_id@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avformat_write_header@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_parameters_copy@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_pix_fmt_to_codec_tag@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwframe_ctx_alloc@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_mallocz@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_find_input_format@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_dict_free@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_get_hw_frames_parameters@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwdevice_get_type_name@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avio_close@LIBAVFORMAT_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_frame_free@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_bsf_init@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_close@LIBAVCODEC_58'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `av_hwdevice_find_type_by_name@LIBAVUTIL_56'
../../lib/libopencv_videoio.so.4.5.3: undefined reference to `avcodec_get_context_defaults3@LIBAVCODEC_58'
collect2: error: ld returned 1 exit status
make[2]: *** [apps/visualisation/CMakeFiles/opencv_visualisation.dir/build.make:89: bin/opencv_visualisation] Error 1
make[1]: *** [CMakeFiles/Makefile2:3357: apps/visualisation/CMakeFiles/opencv_visualisation.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 49%] Linking CXX shared library ../../lib/libopencv_calib3d.so
[ 49%] Built target opencv_calib3d
[ 50%] Linking CXX static library ../../lib/libopencv_ts.a
[ 50%] Built target opencv_ts
make: *** [Makefile:163: all] Error 2




I dont know what's wrong with it,It has confused me for a few days,I real hope someone can help me solve the prob.
I promise the the ffmpeg version match the version of opencv strictly,promising the PKG_CONFIG_PATH is right.


I have tried many method like changing opencv version or ffmpeg version,recompiling the ffmpeg,changing PKG_CONFIG_PATH,coping ffmpeg pc file from /usr/local/ffmpeg/lib/pkgconfig to /usr/local/lib/pkgconfig.
I hope somebody can give some idea about how to solve this problem.


-
The command "brew uninstall ffmpeg" gives me a permission error
21 septembre 2024, par digitI get this Error :



Error: Permission denied - /usr/local/lib/libswscale.dylib




What is this dylib for ? I upgraded and broke my installation by that (i assume) and tried to uninstall and unlinked. Unlink worked. uninstall gave me the error.



What is the correct procedere ?
sudo brew uninstall ffmpeg
?


Why did I upgrade ? It worked fine before ...