Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
ffmpeg mp4 to hls chunks of similar duration
25 mai 2018, par AbhishekI am using below command to convert
mp4
tohls
format usingffmpeg
. Everything is working fine expect for the fact that the output chunk have random duration chunk size.ffmpeg -i ad1.mp4 -strict -2 preset:v veryfast -profile:v baseline -level 3.0 -start_number 0 -hls_list_size 0 -hls_segment_filename 'sample-%06d.ts' -f hls sample.m3u8
I even tried using
-hls_time 10
it somewhat solves my issue, the time is not 10 static. I can totally bear the first and last chunk of different size than specified. Is there any strict way to do that.Sample Output: Link
Output when using -hls_time 10: Link
-
How to use palettegen and paletteuse filters with FFmpeg for image sequences ?
25 mai 2018, par KonstantinI have converted a short video to gif with the help of the following script:
#!/bin/sh palette="/tmp/palette.png" filters="fps=15,scale=320:-1:flags=lanczos" ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
However when I convert an image sequence, I get error message: "Filter paletteuse has a unconnected output"
#!/bin/sh palette="/tmp/palette.png" filters="fps=25" ffmpeg -v warning -f image2 -i %04d.jpg -vf "$filters,palettegen" -y $palette ffmpeg -v warning -f image2 -i %04d.jpg -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
How can I make palettegen and paletteuse work with the image sequences too?
-
ffmpeg overlay image with fade in and fade out
25 mai 2018, par ArmandSo I had a PNG overlay a video, and this was working perfectly, now I want the same png that worked previously only show for a certain duration, and have it fade in and fade out.
But my new command just has no image, where in the past it had the image.
Can you please assist, maybe I am just attempting it incorrectly.
ffmpeg.exe -i "20180523152257.mp4" -i "20180523152257.mp4.png" -filter_complex "[1:v]format=rgba,fade=in:st=1:d=3:alpha=1,fade=out:st=6:d=3:alpha=1 [ovr]; [0][ovr] overlay" -codec:a copy "OUT.mp4"
-
FFPLAY read mp4 file from HTTP sever : report error : stream 1, offset 0x1c33 : partial file
25 mai 2018, par whmiaoI use command line like:
ffplay http://192.168.4.56:5656/files/video/failed_111.mp4
output: ffplay version N-87130-g2b9fd15 Copyright (c) 2003-2017 the FFmpeg developers built with gcc 7.1.0 (GCC) configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --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-zlib libavutil 55. 74.100 / 55. 74.100 libavcodec 57.104.100 / 57.104.100 libavformat 57. 79.100 / 57. 79.100 libavdevice 57. 8.100 / 57. 8.100 libavfilter 6.101.100 / 6.101.100 libswscale 4. 7.103 / 4. 7.103 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025048e0] stream 1, offset 0x1c33: partial file [mov,mp4,m4a,3gp,3g2,mj2 @ 00000000025048e0] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(tv, bt709), 544x960, 1140 kb/s): unspecified pixel format Consider increasing the value for the 'analyzeduration' and 'probesize' options
I download the file,Open local storage,It works well,like:
ffplay e:\failed_111.mp4
file can download from: https://pan.baidu.com/s/19H9cl3YAjG-AK60nIn0KzQ
-
Ffmpeg not compiling
25 mai 2018, par Robin BetkaI'm trying to compile ffmpeg 4.0 for Android (using Ubuntu 64 bit) but I can not get it to work. I was able to compile it for Linux itself fairly fast, but now struggling using the NDK. I'm unexperienced with this so I might have some major flaw somewhere. All paths and files exist. Github tutorials are extremely outdated and don't work as well for me with different errors.
Getting following error:
In file included from ./libavformat/internal.h:24:0, from libavdevice/alldevices.c:23: /home/lit/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi- 4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux- androideabi/4.9.x/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory # include_next ^ compilation terminated. ffbuild/common.mak:60: recipe for target 'libavdevice/alldevices.o' failed make: *** [libavdevice/alldevices.o] Error 1
My build script:
SYSROOT=/home/lit/Android/Sdk/ndk-bundle/platforms/android-14/arch-arm/ TOOLCHAIN=/home/lit/Android/Sdk/ndk-bundle/toolchains/arm-linux-androideabi- 4.9/prebuilt/linux-x86_64 cd ffmpeg/ffmpeg && \ PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \ --prefix="$HOME/ffmpeg_build" \ --pkg-config-flags="--static" \ --extra-cflags="-O3 -Wall -pipe -ffast-math -fstrict-aliasing -Werror=strict- aliasing -Wno-psabi -Wa,--noexecstack -DANDROID -DNDEBUG-march=armv5te -mtune=arm9tdmi -msoft-float"\ --extra-ldflags="-L$HOME/ffmpeg_build/lib" \ --bindir="$HOME/bin" \ --arch=arm \ --target-os=linux \ --enable-cross-compile \ --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \ --cpu=armv5te \ --sysroot=$SYSROOT \ --enable-gpl \ --enable-small \ --enable-nonfree && \ PATH="$HOME/bin:$PATH" make && \ make -j2 && \ make install && \ hash -r
Thank you for your help.