Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
ffmpeg : Frame perfect overlay of two videos
13 mai 2018, par SuperUser_NoviceI'm using ffmpeg to overlay two videos, one being a collection of qr codes to be used later to check for streaming errors.
The problem I'm having is that despite creating a video using the same framerate and number of frames, I can't get my program to match the frames up in such a way that they overlay frame for frame.
I haven't been able to find a way to specify to ffmpeg that it should overlay based on frames rather than duration and timestamps. As a result the zbar scanner is picking up duplicated and dropped frames every 700 or so frames into the video.
(edit: It was later found that this does not appear to be possible, thus I came up with a very hacky way of getting frame-perfect overlay, detailed in the answers.)
-
ffmpeg EOF error when converting stream
13 mai 2018, par macawmanI am trying to capture a single frame and save as a image file using ffmpeg from the command line in linux. I am using the command below with other streams without any issues. With one stream I am getting an error that looks like "http://ip: End of file"
ffmpeg -i http://ip -r 1 -qscale 1 -vframes 1 -y -f image2 t.jpg
I am not sure what is different between these stream except maybe a different resolution. I was wondering if anything can be changed or added to the command to possibly get this stream to work?
thanks
-
Retrieve information from output using Windows Batch
13 mai 2018, par HASJI want to get this FFmpeg output:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Videos\youtube.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.28.100 Duration: 00:27:58.85, start: 0.000000, bitrate: 12157 kb/s Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 12024 kb/s, 23.98 fps, 23.98 tbr, 11988 tbn, 47.95 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265)) Stream #0:1 -> #0:1 (copy) Press [q] to stop, [?] for help Output #0, matroska, to 'D:\Videos\youtube.mkv': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf57.83.100 Stream #0:0(eng): Video: hevc (libx265), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 23.98 tbc (default) Metadata: handler_name : VideoHandler encoder : Lavc57.107.100 libx265 Stream #0:1(eng): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp, 129 kb/s (default) Metadata: handler_name : SoundHandler frame= 19 fps=0.0 q=-0.0 size= 3kB time=00:00:00.98 bitrate= 24.7kbits/s speed= 1.9x frame= 26 fps= 25 q=-0.0 size= 3kB time=00:00:01.00 bitrate= 24.1kbits/s speed=0.972x frame= 36 fps= 22 q=-0.0 size= 3kB time=00:00:01.47 bitrate= 16.4kbits/s speed=0.913x frame= 48 fps= 22 q=-0.0 size= 3kB time=00:00:01.96 bitrate= 12.3kbits/s speed=0.895x frame= 61 fps= 22 q=-0.0 size= 3kB time=00:00:02.94 bitrate= 8.2kbits/s speed=1.07x frame= 79 fps= 24 q=-0.0 size= 3kB time=00:00:03.43 bitrate= 7.0kbits/s speed=1.05x frame= 95 fps= 25 q=-0.0 size= 3kB time=00:00:04.41 bitrate= 5.5kbits/s speed=1.17x frame= 107 fps= 25 q=-0.0 size= 3kB time=00:00:04.90 bitrate= 4.9kbits/s speed=1.14x frame= 112 fps= 23 q=-0.0 size= 3kB time=00:00:04.90 bitrate= 4.9kbits/s speed=1.02x frame= 121 fps= 23 q=-0.0 size= 3kB time=00:00:05.39 bitrate= 4.5kbits/s speed=1.01x frame= 130 fps= 22 q=-0.0 size= 3kB time=00:00:05.88 bitrate= 4.1kbits/s speed=0.998x frame= 136 fps= 21 q=-0.0 size= 2971kB time=00:00:05.88 bitrate=4133.5kbits/s speed=0.911x frame= 142 fps= 20 q=-0.0 size= 2971kB time=00:00:06.37 bitrate=3815.4kbits/s speed=0.912x frame= 147 fps= 20 q=-0.0 size= 2971kB time=00:00:06.37 bitrate=3815.4kbits/s speed=0.851x frame= 154 fps= 19 q=-0.0 size= 2971kB time=00:00:06.86 bitrate=3543.2kbits/s speed=0.856x frame= 160 fps= 19 q=-0.0 size= 2971kB time=00:00:07.36 bitrate=3306.8kbits/s speed=0.862x frame= 168 fps= 18 q=-0.0 size= 2971kB time=00:00:07.36 bitrate=3306.8kbits/s speed=0.808x frame= 177 fps= 18 q=-0.0 size= 2971kB time=00:00:07.85 bitrate=3100.0kbits/s speed=0.815x frame= 190 fps= 19 q=-0.0 size= 2971kB time=00:00:08.32 bitrate=2925.3kbits/s speed=0.818x frame= 191 fps= 18 q=-0.0 size= 2971kB time=00:00:08.32 bitrate=2925.3kbits/s speed=0.777x frame= 201 fps= 18 q=-0.0 size= 2971kB time=00:00:08.76 bitrate=2775.8kbits/s speed=0.782x frame= 212 fps= 18 q=-0.0 size= 2971kB time=00:00:09.23 bitrate=2634.9kbits/s speed=0.788x frame= 220 fps= 18 q=-0.0 size= 2971kB time=00:00:09.68 bitrate=2513.0kbits/s speed=0.789x frame= 231 fps= 18 q=-0.0 size= 2971kB time=00:00:09.98 bitrate=2437.7kbits/s speed=0.778x frame= 240 fps= 17 q=-0.0 Lsize= 6190kB time=00:00:09.98 bitrate=5078.7kbits/s speed=0.726x video:6018kB audio:164kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.129100%
And set the
frame=
andfps=
values to variables.I suppose that can be achieved by outputting this to a text file (FFmpeg outputs everything to STDERR) and using
FOR
with tokens and delims but, as you may know, FFmpeg outputs that information in real time and that's where I get stuck. Does the batch need to be broken down into smaller files and use theCALL
command to get the information (just an idea)?I need some way to periodically check the lines with frame= and fps= outputs, put their values in variables and the rest I may already know how to do.
The purpose of getting these into variables is to calculate a percentage and an ETA for the video conversion.
Thanks in advance.
-
ERROR : libmp3lame >= 3.98.3 not found
12 mai 2018, par Prasad RevanakiI am installing ffmpeg utility, but I am facing
libmp3lame >= 3.98.3
not found not found error. I am able to findlame-3.99.5-1.el6.rf.x86_64.rpm
andlame-libs-3.98.4-1.el6.nux.x86_64.rpm
but installing these are not solving the problem. I am not able to find libmp3lame rpm to install.Can anyone help me here?
[root@sdp-dev-03:/opt/ffmpeg] # ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs=-ldl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvo-aacenc --enable-libxvid --disable-ffplay --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads
ERROR: libmp3lame >= 3.98.3 not found
If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org
mailing list or IRC#ffmpeg
onirc.freenode.net
. Include the log file "config.log" produced by configure as this will help solve the problem. -
FFMPEG : how to pick a random jpeg file from folder
12 mai 2018, par J. J.I run a batch script in expert mode with the program myffvideoconverter.
My ffmpeg code is: -i example.jpg
I would like to choose a random jpeg file from the folder automatically instead the file "example.jpg" Is it possible? Is it possible to copy the used file into a different folder automatically to make sure that no jpeg will be used two times? Thank you for your help.