
Recherche avancée
Autres articles (45)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (4385)
-
VB.NET FFMPEG Stops
18 mars 2012, par Mcqueen_23Hi evryone i'm trying to convert files using ffmpeg
my codes only fetched
— -Skip--- Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Enrique Iglesias - Tonight.mp4' : Metadata : major_brand : mp42 minor_version : 0 compatible_brands : isommp42 creation_time : 2011-03-20 19:07:02 Duration : 00:03:50.05, start : 0.000000, bitrate : 219 kb/s Stream #0.0(und) : Video : h264, yuv420p, 480x360 [PAR 1:1 DAR 4:3], 117 kb/s, 29.97 fps, 59.75 tbr, 1k tbn, 59.83 tbc Metadata : creation_time : 1970-01-01 00:00:00 Stream #0.1(und) : Audio : aac, 44100 Hz, stereo, s16, 95 kb/s Metadata : creation_time : 2011-03-20 19:07:03 Output #0, mp3, to 'Enrique Iglesias - Tonight.mp3' : Metadata : major_brand : mp42 minor_version : 0 compatible_brands : isommp42 TDEN : 2011-03-20 19:07:02 TSSE : Lavf52.94.0 Stream #0.0(und) : Audio : libmp3lame, 44100 Hz, stereo, s16, 64 kb/s Metadata : creation_time : 2011-03-20 19:07:03and cannot i cannot get the next lines ung
Proccess.ErrorDataReceived
eventHere are my Codes
Public Structure ItemStruct
Public ID, URL, FileName, FileExt, ConvertExt, ConvertQuery As String
Public FileSize As Int64
Public Method, status As Method
Public prog_bar As ProgressBar
Public DeleteOrigin, TrimStart, TrimEnd As Boolean
End Structure
Friend Class Converter
Public busy As Boolean = False
Private _Item As ItemStruct
Public Event ProgressChange(ByVal id As String, ByVal percent As Integer, ByVal etr As TimeSpan)
Public Event ConvertFinish(ByVal id As String)
Private m As Threading.Thread
Private WithEvents timer As New Timer With {.Interval = 100}
Public Sub New()
End Sub
Public Sub New(ByVal item As ItemStruct)
_Item = item
m = New Threading.Thread(AddressOf Convert)
End Sub
Public Sub Start()
m.Start()
timer.Start()
End Sub
Private duration As Decimal = 0.0F
Private current As Decimal = 0.0F
Private varIsSet As Boolean = False
Private Sub Convert()
Dim cmd As String = _Item.ConvertQuery
Dim inputName As String = _Item.URL
Dim fName As String = _Item.FileName & _Item.FileExt
Dim dir As String = _Item.URL.Replace(fName, "")
Dim ouputName As String = dir & _Item.FileName & "." & _Item.ConvertExt
cmd = Replace(cmd, "--i", inputName)
cmd = Replace(cmd, "--o", ouputName)
cmd = cmd.Remove(0, 6)
cmd = cmd.Trim
Dim proc As New Process
With proc.StartInfo
.FileName = Path.Combine(Application.StartupPath, "ffmpeg.exe")
.Arguments = cmd
proc.EnableRaisingEvents = False
.UseShellExecute = False
.CreateNoWindow = True
.RedirectStandardError = True
.RedirectStandardOutput = True
.RedirectStandardInput = True
AddHandler proc.ErrorDataReceived, AddressOf UpdateData
proc.Start()
proc.BeginErrorReadLine()
End With
End Sub
Public Sub Cancel()
m.Abort()
End Sub
Private Sub UpdateData(ByVal sender As Object, ByVal e As DataReceivedEventArgs)
Dim s As String = e.Data
If s.Contains("Duration: ") Then
duration = GetDuration(s)
ElseIf s.Contains("frame=") Then
current = GetTime(s)
Else
Dim proc As Process = DirectCast(sender, Process)
Dim m As Match = Regex.Match(s, "^File\ '(.*?)'\ already\ exists", RegexOptions.IgnoreCase)
If m.Success Then
Dim w As StreamWriter = proc.StandardInput
If MessageBox.Show("File '" & m.Groups(1).ToString & "' already exists." & vbNewLine & "Do you want to Overwrite existing file?", "Overwrite", MessageBoxButtons.YesNo) = DialogResult.Yes Then
w.WriteLine("y")
Else
w.WriteLine("n")
End If
End If
'RaiseEvent ConvertFinish(_Item.ID)
'proc.WaitForExit()
'proc.Close()
End If
Debug.Print(s)
If Not duration And Not current Then varIsSet = False Else varIsSet = True
End Sub
Private Function GetDuration(ByVal s As String) As Double
Dim m As Match = Regex.Match(s, "Duration: ((.*?), (.*))")
If m.Success Then
Dim duration As String = m.Groups(2).ToString
Return TimeSpan.Parse(duration).TotalSeconds
End If
Return Nothing
End Function
Private Function GetTime(ByVal s As String) As Double
Dim m As Match = Regex.Match(s, "(.*) time=(.*) bitrate")
If m.Success Then
Dim currentTime As String = m.Groups(2).ToString
Return TimeSpan.Parse(currentTime).TotalSeconds
End If
Return Nothing
End Function
Private Sub timer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles timer.Tick
If varIsSet Then
Dim etr As TimeSpan = TimeSpan.FromSeconds(CInt(current / duration))
etr = New TimeSpan(etr.Hours, etr.Minutes, etr.Seconds)
RaiseEvent ProgressChange(_Item.ID, CInt((current / duration) * 100 * 100), etr)
End If
End Sub
End Class -
Everytime I run my code ffmpeg responds with this instead of doing its function. How do I fix ?
25 juillet 2023, par Oreo FOutput from ffmpeg/avlib:

ffmpeg version 2023-07-19-git-efa6cec759-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 58. 14.100 / 58. 14.100
 libavcodec 60. 22.100 / 60. 22.100
 libavformat 60. 10.100 / 60. 10.100
 libavdevice 60. 2.101 / 60. 2.101
 libavfilter 9. 8.102 / 9. 8.102
 libswscale 7. 3.100 / 7. 3.100
 libswresample 4. 11.100 / 4. 11.100
 libpostproc 57. 2.100 / 57. 2.100



Everytime I run the code it does this.


code :


import praw
import requests
import cv2
import os
from pydub import AudioSegment

def download_video(url, filename):
 response = requests.get(url)
 with open(filename, 'wb') as f:
 f.write(response.content)

def combine_videos(video_urls, output_filename):
 video_clips = []
 audio_clips = []
 for i, url in enumerate(video_urls):
 temp_filename = f'temp_video_{i}.mp4'
 download_video(url, temp_filename)
 video_clip = cv2.VideoCapture(temp_filename)
 audio_clip = AudioSegment.from_file(temp_filename, format="mp4")
 video_clips.append(video_clip)
 audio_clips.append(audio_clip)
 
 if not video_clips:
 print("No video clips to combine.")
 return

 frame_width = int(video_clips[0].get(cv2.CAP_PROP_FRAME_WIDTH))
 frame_height = int(video_clips[0].get(cv2.CAP_PROP_FRAME_HEIGHT))
 fps = int(video_clips[0].get(cv2.CAP_PROP_FPS))

 fourcc = cv2.VideoWriter_fourcc(*'mp4v')
 output_clip = cv2.VideoWriter(output_filename, fourcc, fps, (frame_width, frame_height))

 for i, video_clip in enumerate(video_clips):
 while True:
 ret, frame = video_clip.read()
 if not ret:
 break
 output_clip.write(frame)
 
 for video_clip in video_clips:
 video_clip.release()
 
 output_clip.release()

 # Combining audio using pydub
 combined_audio = sum(audio_clips)
 combined_audio.export("combined_audio.mp3", format="mp3")

 # Merging audio with video using ffmpeg
 os.system(f'ffmpeg -i {output_filename} -i combined_audio.mp3 -c:v copy -c:a aac -strict experimental -map 0:v:0 -map 1:a:0 final_output.mp4')

 # Cleaning up temporary files
 os.remove("combined_audio.mp3")

def main():
 reddit = praw.Reddit(
 client_id='XXX',
 client_secret='XXX',
 user_agent='Reddit Video Downloader'
 )
 
 subreddit_name = input("Enter the name of the subreddit: ")
 limit = int(input("Enter the number of videos to download: "))
 
 subreddit = reddit.subreddit(subreddit_name)
 submissions = subreddit.hot(limit=limit)
 
 video_urls = [submission.url for submission in submissions if submission.media and 'reddit_video' in submission.media]
 
 if video_urls:
 output_filename = input("Enter the output filename (e.g., output.mp4): ")
 combine_videos(video_urls, output_filename)
 print("Videos combined successfully!")
 else:
 print("No Reddit videos found in the subreddit.")

if __name__ == "__main__":
 main()



Anyone got any idea why this happens ?


I'm making a script that scrapes videos from a specific subreddit.


Also if it helps the temp video file is corrupted when it gets made.


I've put this into chatGPT as well and brought an expert friend and he hasn't been able to help me.


-
cannot link ffmpeg libraries for my own Qt project
14 août 2013, par Dan TEDIT : Question solved (see bottom)
I have spent MANY hours searching for a solution to my problem, but have not managed. I am on OSX and trying to link ffmpeg to my own Qt project. I have tried to do the simplest thing possible but even this does not work :
After gettings yasm and x264 installed, I ran
./configure —enable-static —enable-gpl —enable-libx264 and then
make && make installffmpeg runs fine when I then try to run it on the command line. I then just set up a simple project in the ffmpeg directory with the following ffmpeg.pro file :
TEMPLATE = app
QT += core
INCLUDEPATH += /usr/local/include
LIBS += -L/usr/local/lib
LIBS += -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswresample -lswscale -lavutil -lpthread -lbz2 -lm -lz -lx264
HEADERS += ffmpeg.h
SOURCES += ffmpeg.cI'm not sure whether I need all those libraries, but they were all the .a files that ffmpeg created. When I try to build the project (as is), I get the following linker error :
g++ -headerpad_max_install_names -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -o ffmpeg.app/Contents/MacOS/ffmpeg ffmpeg.o -F/Users/dtamayo/QtSDK/Desktop/Qt/4.8.1/gcc/lib -L/Users/dtamayo/QtSDK/Desktop/Qt/4.8.1/gcc/lib -L/usr/local/lib -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswresample -lswscale -lavutil -lpthread -lbz2 -lm -lz -lx264 -framework QtGui -L/usr/local/pgsql/lib -L/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib -F/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib -framework QtCore
ld : warning : directory not found for option '-L/usr/local/pgsql/lib'
ld : warning : directory not found for option '-L/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib'
ld : warning : directory not found for option '-F/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib'
Undefined symbols for architecture x86_64 :
"_audio_sync_method", referenced from :
_write_frame in ffmpeg.o
_do_audio_out in ffmpeg.o
"_audio_volume", referenced from :
_transcode_init in ffmpeg.o
"_cmdutils_read_file", referenced from :
_transcode_init in ffmpeg.o
"_configure_filtergraph", referenced from :
_decode_audio in ffmpeg.o
_decode_video in ffmpeg.o
_transcode_init in ffmpeg.o
"_copy_tb", referenced from :
_transcode_init in ffmpeg.o
"_copy_ts", referenced from :
_process_input in ffmpeg.o
"_debug_ts", referenced from :
_write_frame in ffmpeg.o
_do_audio_out in ffmpeg.o
_do_video_out in ffmpeg.o
_decode_video in ffmpeg.o
_process_input in ffmpeg.o
"_do_benchmark", referenced from :
_ffmpeg_cleanup in ffmpeg.o
_main in ffmpeg.o
"_do_benchmark_all", referenced from :
_update_benchmark in ffmpeg.o
"_do_hex_dump", referenced from :
_check_keyboard_interaction in ffmpeg.o
_process_input in ffmpeg.o
"_do_pkt_dump", referenced from :
_check_keyboard_interaction in ffmpeg.o
_process_input in ffmpeg.o
"_dts_delta_threshold", referenced from :
_process_input in ffmpeg.o
"_dts_error_threshold", referenced from :
_do_video_out in ffmpeg.o
_process_input in ffmpeg.o
"_exit_on_error", referenced from :
_write_frame in ffmpeg.o
_do_subtitle_out in ffmpeg.o
_process_input in ffmpeg.o
"_exit_program", referenced from :
_sigterm_handler in ffmpeg.o
_assert_avoptions in ffmpeg.o
_abort_codec_experimental in ffmpeg.o
_write_frame in ffmpeg.o
_do_audio_out in ffmpeg.o
_do_subtitle_out in ffmpeg.o
_do_video_out in ffmpeg.o
...
"_ffmpeg_parse_options", referenced from :
_main in ffmpeg.o
"_frame_bits_per_raw_sample", referenced from :
_transcode_init in ffmpeg.o
"_iconv", referenced from :
_avcodec_decode_subtitle2 in libavcodec.a(utils.o)
"_iconv_close", referenced from :
_avcodec_decode_subtitle2 in libavcodec.a(utils.o)
_avcodec_open2 in libavcodec.a(utils.o)
"_iconv_open", referenced from :
_avcodec_decode_subtitle2 in libavcodec.a(utils.o)
_avcodec_open2 in libavcodec.a(utils.o)
"_init_simple_filtergraph", referenced from :
_transcode_init in ffmpeg.o
"_ist_in_filtergraph", referenced from :
_decode_audio in ffmpeg.o
_decode_video in ffmpeg.o
"_options", referenced from :
_main in ffmpeg.o
(maybe you meant : _ff_mpv_generic_options, _ff_rawvideo_options , _av_set_options_string , _ff_rtsp_options )
"_parse_loglevel", referenced from :
_main in ffmpeg.o
"_parse_time_or_die", referenced from :
_parse_forced_key_frames in ffmpeg.o
"_print_error", referenced from :
_write_frame in ffmpeg.o
_process_input in ffmpeg.o
"_print_stats", referenced from :
_print_report in ffmpeg.o
"_qp_hist", referenced from :
_print_report in ffmpeg.o
_check_keyboard_interaction in ffmpeg.o
"_register_exit", referenced from :
_main in ffmpeg.o
"_show_banner", referenced from :
_main in ffmpeg.o
"_show_usage", referenced from :
_main in ffmpeg.o
"_stdin_interaction", referenced from :
_transcode in ffmpeg.o
"_uninit_opts", referenced from :
_ffmpeg_cleanup in ffmpeg.o
"_video_sync_method", referenced from :
_write_frame in ffmpeg.o
_do_video_out in ffmpeg.o
_transcode_init in ffmpeg.o
"_vstats_filename", referenced from :
_ffmpeg_cleanup in ffmpeg.o
_do_video_out in ffmpeg.o
_do_video_stats in ffmpeg.o
_flush_encoders in ffmpeg.o
ld : symbol(s) not found for architecture x86_64
collect2 : ld returned 1 exit status
make : Leaving directory `/Users/dtamayo/Desktop/ffmpeg-build-desktop-Desktop_Qt_4_8_1_for_GCC__Qt_SDK__Debug'
make : * [ffmpeg.app/Contents/MacOS/ffmpeg] Error 1
14:35:42 : The process "/usr/bin/make" exited with code 2.
Error while building project ffmpeg (target : Desktop)
When executing build step 'Make'
EDIT :
Thank you very much for your quick responses. I'm embarrassed to say that with the help of a friend I found the problem, so I'll add the solution here in case there are others as inept as I am that run into the same issue !
The problem is that I hadn't added the following source files to the project, which do not get built as part of one of the ffmpeg libraries :
cmdutils.c ffmpeg_filter.c ffmpeg_opt.c
In addition, I had to add usr/lib to my library path, and add the library -liconv.