
Recherche avancée
Autres articles (48)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
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 (...) -
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 (9135)
-
Crash in ffmpeg avcodec_free_context in one application but not in other
5 novembre 2017, par geekowlI am building an application in C++ on Windows 10 using Microsoft Visual Studio 2012 Professional.
I have created a wrapper library around ffmpeg (libavcodec) to encode video in H.264 format using libx264. This wrapper contains following functions :
Initialize()
Open()
EncodeFrame()
Close()
Uninitialize()I created a test application to test the wrapper library. The test application works perfectly fine.
When I use the wrapper library in my actual main application, the main application crashes in
Close()
API. Inside close, it crashes inavcodec_free_context()
. The difference between the main application and the test application is that the main application links with some more dependent libraries that test application does not link with.To debug the problem in the main application, I put
avcodec_free_context()
in Open() after the context is allocated. The crash occurs ifavcodec_free_context()
is put at a certain point as shown below.pCodecContext = avcodec_alloc_context3(pCodec);
// <---- No crash here.
pCodecContext->bit_rate = 200000;
pCodecContext->width = 320;
pCodecContext->height = 240;
.
.
.
if (pCodec->id == AV_CODEC_ID_H264)
{
av_opt_set(pCodecContext->priv_data, "preset", "slow", 0);
av_opt_set(pCodecContext->priv_data, "tune", "zerolatency", 0);
}
pCodecContext->flags |= CODEC_FLAG_GLOBAL_HEADER;
// <-- No crash here
if (avcodec_open2(pCodecContext, pCodec, NULL) < 0)
{
return -1;
}
// <-- Crash here [avcodec_free_context(&pCodecContext);]What is a correct approach to identify and resolve this problem ?
Thanks in advance.
Update
I found out that ffmpeg was built using gcc. That was causing the crash. I rebuilt ffmpeg using Visual Studio. That solved problem.
-
Why doesn't the ffmpeg output display the stream in the browser ? [closed]
10 mai 2024, par TebyyWhy is it that when I create a livestream in Python using ffmpeg, and then I open the browser and visit the page, the page keeps loading continuously, and in PyCharm logs, I see binary data ? There are no errors displayed, and the code seems correct to me. I even tried saving to a file for testing purposes, and when I play the video, everything works fine. Does anyone know what might be wrong here ?


Code :


def generate_frames():
 cap = cv2.VideoCapture(os.path.normpath(app_root_dir().joinpath("data/temp", "video-979257305707693982.mp4")))
 while cap.isOpened():
 ret, frame = cap.read()
 if not ret:
 break

 yield frame


@app.route('/video_feed')
def video_feed():
 ffmpeg_command = [
 'ffmpeg', '-f', 'rawvideo', '-pix_fmt', 'bgr24',
 '-s:v', '1920x1080', '-r', '60',
 '-i', '-', '-vf', 'setpts=2.5*PTS', # Video Speed
 '-c:v', 'libvpx-vp9', '-g', '60', '-keyint_min', '60',
 '-b:v', '6M', '-minrate', '4M', '-maxrate', '12M', '-bufsize', '8M',
 '-crf', '0', '-deadline', 'realtime', '-tune', 'psnr', '-quality', 'good',
 '-tile-columns', '6', '-threads', '8', '-lag-in-frames', '16',
 '-f', 'webm', '-'
 ]
 ffmpeg_process = subprocess.Popen(ffmpeg_command, stdin=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=-1)
 frames_generator = generate_frames()
 for frame in frames_generator:
 ffmpeg_process.stdin.write(frame)
 ffmpeg_process.stdin.flush()

 ffmpeg_process.stdin.close()
 ffmpeg_process.wait()

 def generate_video_stream(process):
 startTime = time.time()
 buffer = []
 sentBurst = False
 for chunk in iter(lambda: process.stderr.read(4096), b''):
 buffer.append(chunk)

 # Minimum buffer time, 3 seconds
 if sentBurst is False and time.time() > startTime + 3 and len(buffer) > 0:
 sentBurst = True
 for i in range(0, len(buffer) - 2):
 print("Send initial burst #", i)
 yield buffer.pop(0)

 elif time.time() > startTime + 3 and len(buffer) > 0:
 yield buffer.pop(0)

 process.poll()
 if isinstance(process.returncode, int):
 if process.returncode > 0:
 print('FFmpeg Error', process.returncode)

 break

 return Response(stream_with_context(generate_video_stream(ffmpeg_process)), mimetype='video/webm', content_type="video/webm; codecs=vp9", headers=Headers([("Connection", "close")]))




-
fate : add a case for ticket #3229
12 août 2019, par Zhong Li