Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
ffmpeg.autogen ffmpeg.avformat_write_header(ofmt_ctx, null) error -22
17 mai 2019, par errod1Error when writing the file header, when copying a video streaming to an mp4 file, when the source is a file it executes without errors, but when it is a url type rtmp: // it gives error -22
C# Visual2015 ffmpeg.autogen 4.1.0.4
-
An error occured 'maybe incorrect parameters such as bit_rate, rate, width or height' when I encode my video
17 mai 2019, par CrystalI always use this source code when I encode my videos. they are almost 1920x1080 videos. but An error occured when I tried to encode a 7680x3840 video.
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.4.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.100 / 57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 [avisynth @ 03af8040] Stream #0: not enough frames to estimate rate; consider increasing probesize Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, avisynth, from 'a.mp4.avs': Duration: 00:00:01.85, start: 0.000000, bitrate: 2 kb/s Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 7680x3840, 60 fps, 60 tbr, 60 tbn, 60 tbc Stream #0:1: Audio: pcm_f32le, 48000 Hz, stereo, flt, 3072 kb/s [libx264 @ 054c5c20] VBV maxrate specified, but no bufsize, ignored [libx264 @ 054c5c20] frame MB size (480x240) > level limit (8192) [libx264 @ 054c5c20] DPB size (4 frames, 460800 mbs) > level limit (0 frames, 32768 mbs) [libx264 @ 054c5c20] MB rate (6912000) > level limit (245760) [libx264 @ 054c5c20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2 x264 [error]: malloc of size 152432416 failed Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264)) Stream #0:1 -> #0:1 (pcm_f32le (native) -> aac (native)) Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
there is a strange message. 'malloc of size 152432416 failed' I think this is memory problem but I have no idea to solve this problem.
This is avs file
PluginPath = "D:\Application\Frame_Doubling_Set_Drag_And_Drop\ffmpeg-Convert-TrueMotion-x86_Newer_Svpflow\_exe\" LoadPlugin(PluginPath + "ffms2.dll") LoadPlugin(PluginPath + "svpflow1.dll") LoadPlugin(PluginPath + "svpflow2.dll") LoadPlugin(PluginPath + "mvtools2.dll") Video=FFVideoSource("a.mp4", threads=8) Audio=FFAudioSource("a.mp4") Audiodub(Video, Audio) Import(PluginPath + "InterFrame2.avsi") InterFrame(GPU=true, Preset="Medium", FrameDouble=true, NewNum=60000, NewDen=1000, Cores=8)
and this is batch file
@echo off CD /D "%~dp1" cls set DestPath=%~dp1 set Src0=%~nx1 set Src1=%~n1 set DestExt=.mp4 set Dest0=%DestPath%\%Src1%-Cnv%DestExt% set Dest1=%DestPath%\%Src1%-Cnv-New%DestExt% set exe=%~dp0_exe\ffmpeg.exe set Opt1=-i set Opt2=-c:v libx264 -b:v 200000k -minrate 10k -maxrate 200000k -profile:v high -level 4.1 -pix_fmt yuv420p set Opt3=-c:a aac -ab 192k set Opt4=-f mp4 If Not Exist "%Src0%" (echo. && echo [ %Src0% ] Not Found. && echo. && pause && Goto End) If Exist "%Dest0%" set Dest0=%Dest1% "%exe%" %Opt1% "%Src0%" %Opt2% %Opt3% %Opt4% "%Dest0%" :End If Not Exist "%Dest0%" (echo. && pause) rem pause pause
What's my problem?
-
Terminating FFMPEG from Python using Linux
17 mai 2019, par smartzerSo I have a project that listens for button inputs in Python, and records video from a camera and an external microphone once a certain button is pressed, now when I want to stop recording, I press another button and stop recording on my camera and the microphone, and then I call ffmpeg using the subprocess module:
mergeFiles = subprocess.Popen("sudo ffmpeg -i /home/pi/Video/video.mov -i /home/pi/Audio/test.wav -acodec copy -vcodec copy -map 0:v -map 1:a -shortest /media/pi/USB/Output/output.mkv", shell=True)
to merge the audio and video files I just created.
Now once I call ffmpeg, it doesn't stop until I send the process a signal interrupt from the keyboard... is there a way to either have the process stop as soon as it's done merging, or to automatically terminate/kill ffmpeg after a certain amount of time?
I have read up on other posts like this and none of the solutions work for me. I can't kill the process using the PID because every time I look up ffmpeg's PID, it is a different ID, and calling something like mergeFiles.kill() doesn't work for me.
-
Meaning of "ffprobe -v trace demo.mp4" output
17 mai 2019, par blueskyThe 'mdat box' of Mp4 file may at the last of file. I want to know the position of 'mdat' box using 'ffmpeg' or 'ffprobe'.
Mp4 consists of 'ftyp', 'moov' and 'mdat' BOX. each BOX consists of "BoxHeader" and "BoxData". "BoxHeader" consists of "BoxSize(4Byte)", "BoxType(4Byte)", "BoxLargesize(8Byte, only have when box size exceeding the range of 4Byte expression, then the value of BoxSize is 1)".
In program, you could first read 8 Byte and know the size of 'ftyp box', then seek the size and read 8 Byte to know if the next box is 'moov box'. If not 'moov', it shoud be 'mdat box', then seek cross 'mdat box' to find 'mdat box'...
But I want to use 'ffprobe' to find the position of 'moov'. I use 'ffprobe -v trace demo.mp4', and output is like below
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc8fd000e00] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc8fd000e00] type:'ftyp' parent:'root' sz: 28 8 41044500 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc8fd000e00] ISO: File Type Major Brand: mp42 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc8fd000e00] type:'moov' parent:'root' sz: 17943 36 41044500 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc8fd000e00] type:'mvhd' parent:'moov' sz: 108 8 17935
I want to know the meaning of
type:'ftyp' parent:'root' sz: 28 8 41044500
:type:'ftyp' parent:'root'
is easy to know,sz: 28 8 41044500
is really make me confused, I guess28
is size of ftyp box,but the meaning of8 41044500
is what?Could you explain the meaning of
sz: 28 8 41044500
, and where could find the doc? -
FFMPEG : Add a offset in the Scene Change Detection
17 mai 2019, par stephI am trying to add a frame offset(o) in ffmpeg scene detection filter:
For example:
...filter:v "select='gt(scene,X)
generates frame 10, 34, 300.I looking for a new construction with
o=10
generates frame 20, 44, 310...Thank you for help!