Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Specifying Full input video duration in an ffmpeg expression for crop filter
23 mai 2018, par yoda89I have to use panning effect on a video from left to right, for that I used crop filter and also figured out the expression for the effect, but the expression requires full input video duration. So I was wondering if there is an ffmpeg constant for specifying that. Like we have iw for input width and ih for input height.
I am using the command given below, except that I have to hardcode duration of the input video in place of [DURATION].
ffmpeg -i input.mp4 -vf crop=iw/3:ih:2*t*iw/[DURATION]*3:0 output.mp4
-
input stream error _read() is not implemented : ffmpeg-fluent
23 mai 2018, par Thomsheer AhamedI have buffer object. I want to pass that buffer as readable stream to ffpmeg.
var ffmpeg = require('fluent-ffmpeg'); var ffmpegPath = require("ffmpeg-binaries").ffmpegPath() ffmpeg.setFfmpegPath(ffmpegPath); var command = new ffmpeg(); command.input(my_buffer) .videoCodec('libx264') .size('520x?') .aspect('4:3') .inputFPS(8) .outputFPS(30) .output('new_video.mp4') .on('start', onStrat) .on('progress', onProgress) .on('end', onEnd) .on('error', onError) .run();
If I pass buffer right away I will get "Error: Invalid input at FfmpegCommand.proto.mergeAdd.proto.addInput.proto.input"
So I converted buffer into stream using
function bufferToStream(buffer) { let Duplex = require('stream').Duplex; let stream = new Duplex(); stream.push(new Buffer(buffer)); stream.push(null); return stream; } var red = bufferToStream(finalResponse.file.buffer);
and passed this steam to input
command.input(red)
Above Command throws "ffmpeg exited with code 1: Error opening filters!";
If I use my_buffer and save it in locally using fs.writeFile('path',my_buffer) and pass this path to input of ffmpeg then it works fine..
But I dont want to store that file and then delete it after altering video.
Can some one help me?
-
Regex in filepath
22 mai 2018, par Vít Hněvkovskýcan u help me with regex in FFMpegConverter?
I have a bitmaps a saving them like it:
foreach (Bitmap printscreen in printscreeny) { printscreen.Save(Path.GetTempPath() + guid +"_"+ i); i++; }
then I want to convert them by NReco videoConverter but dont know how to write regex part to describe path.
I have it like it:
videoConverter.ConvertMedia(Path.GetTempPath() + guid + "_"+" *%d.bmp", null,"test.mp4", null, convertSettings);
Thanks
-
FFMPEG RTSP client sending unsolicited error response
22 mai 2018, par Jim RhodesI have a server that pulls live video streams from IP cameras and makes those streams available to clients using RTSP. If I view one of the streams from a PC using ffplay.exe, the stream displays properly and I can pause and resume the stream without any issues.
I have an iOS app originally written by someone else that uses ffmpeg as the RTSP client and I am seeing odd behavior when I try to pause a stream. ffmpeg is version 3.4 and is included in the iOS project as static libraries. I do not know what options were used to build the ffmpeg libraries.
The problem is that after the iOS client sends a PAUSE command via
av_read_pause(AVFormatContext*)
and the server responds with "RTSP/1.0 200 OK", the iOS app sends "RTSP/1.0 501 Not Implemented" back to the server. An RTSP client should never be sending an RTSP response. I have to assume that this is a bug in ffmpeg. Are there known issues with ffmpeg's handling of PAUSE? Should I be usingav_read_pause()
to pause the stream? -
ffmpeg splits video with differents segments size
22 mai 2018, par Rafael Limaim trying to split a video in segments with same lenght using ffmpeg
ffmpeg -y -i teste.mp4 -map 0 -segment_time 10 -f segment -c:v libx264 -preset veryfast -crf 24 -tune film -vf "drawtext=text='teste':start_number=0:x=0:y=0" -an teste\out%d.mp4
the input file is 3minutes
in the output folder i get several files each have a duration between 8 and 13 seconds.
during the process i get many messages like
Past duration 0.994987 too large Past duration 0.998329 too large Past duration 0.995995 too large Past duration 0.997993 too large Past duration 0.998665 too large Past duration 0.999321 too large
also the output file are not printing the "teste" drawtext filter...
does anyone know what is the problem?
how can a really force ffmpeg to split 10 seconds segment (i can accept 9 or 8 seconds segments as an "error margin" but get 13 seconds segments asking for 10 is something really wrong to me)