unable to convert png to movie, error: Invalid PNG signature ,
Hi all, I am trying to convert a set of images to a video file. I have tried various ffmpeg command options but they all have failed. (command & error logs attached: ffmpeg_errors.txt) The following seems to work for me: ffmpeg -f concat -safe 0 -i <(cat <<EOF file '$(pwd)/image01.png' duration 1 file '$(pwd)/image02.png' duration 1 file '$(pwd)/image03.png' duration 1 EOF ) output.avi Is there something on which i am missing out? Please help. Thanks & Regards, Puneet
2016-12-02 11:22 GMT+01:00 Puneet Singh <singh.punit1990@gmail.com>:
I am trying to convert a set of images to a video file. I have tried various ffmpeg command options but they all have failed.
ffmpeg -r 1 -i image%02d.png
Since your files are actually jpeg, not png, you have to force the right decoder: $ ffmpeg -r 1 -vcodec mjpeg -i image%2d.png
--extra-cflags=-fPIC
Why do you think that this makes sense? Please remember that on this mailing list, only current FFmpeg git head is supported. Carl Eugen
Hi , While compiling from sources on linux platform ,i set CFLAG/CXXFLAG to -fPIC. For ffmpeg -fPIC is not necessary (as libraries are static). How you were able to detect the image compression format information (jpeg) from the attached image files? Also , i tried ffmpeg -r 1 -vcodec mjpeg -i image%2d.png -vcodec libx264 -pix_fmt yuv420p video.mp4 and i am stuck at: ffmpeg version 3.2.1 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11) configuration: --prefix=/home/apps/FFMPEG/3.2.1/gnu --extra-cflags=-fPIC --extra-cxxflags=-fPIC --enable-libx264 --enable-gpl 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 Input #0, image2, from 'image%2d.png': Duration: 00:00:00.20, start: 0.000000, bitrate: N/A Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 481x480 [SAR 1:1 DAR 481:480], 25 fps, 25 tbr, 25 tbn, 25 tbc [swscaler @ 0x225d5c0] deprecated pixel format used, make sure you did set range correctly [libx264 @ 0x2248380] *width not divisible by 2* (481x480) Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264)) Error while opening encoder for output stream #0:0 - *maybe incorrect parameters such as bit_rate, rate, width or height* Thanks & Regards, Puneet On 2 December 2016 at 16:51, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
2016-12-02 11:22 GMT+01:00 Puneet Singh <singh.punit1990@gmail.com>:
I am trying to convert a set of images to a video file. I have tried various ffmpeg command options but they all have failed.
ffmpeg -r 1 -i image%02d.png
Since your files are actually jpeg, not png, you have to force the right decoder: $ ffmpeg -r 1 -vcodec mjpeg -i image%2d.png
--extra-cflags=-fPIC
Why do you think that this makes sense?
Please remember that on this mailing list, only current FFmpeg git head is supported.
Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
2016-12-06 11:07 GMT+01:00 Puneet Singh <singh.punit1990@gmail.com>:
While compiling from sources on linux platform ,i set CFLAG/CXXFLAG to -fPIC.
For ffmpeg -fPIC is not necessary (as libraries are static).
If it is not necessary, don't use it. (If it would not have negative effects, it would likely be the default.)
How you were able to detect the image compression format information (jpeg) from the attached image files?
I used "ffmpeg -i input", but I assume "file input" would also have helped.
Also , i tried ffmpeg -r 1 -vcodec mjpeg -i image%2d.png -vcodec libx264 -pix_fmt yuv420p video.mp4 and i am stuck at:
ffmpeg version 3.2.1 Copyright (c) 2000-2016 the FFmpeg developers
Again: Only current FFmpeg git head is supported here.
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11) configuration: --prefix=/home/apps/FFMPEG/3.2.1/gnu --extra-cflags=-fPIC --extra-cxxflags=-fPIC --enable-libx264 --enable-gpl
See above.
[libx264 @ 0x2248380] *width not divisible by 2* (481x480)
What is unclear about this message? (Except for the asterisks.) Please remember not to top-post here, Carl Eugen
Am 06.12.2016 um 11:07 schrieb Puneet Singh:
[libx264 @ 0x2248380] *width not divisible by 2* (481x480)
481:480 is the problem hence when we calcultae values for padding in our php wrapper code pieces like below, you won't see that 1 pixel and it don't fail $diff = round($h_target - ($w_target / $vh_source)); if(fmod($diff, 2) <> 0) { $diff = $diff + 1; } $diff_single = $diff / 2; if(fmod($diff_single, 2) <> 0) { $diff_single = $diff_single + 1; } $this->pad_top = $diff_single;
participants (3)
-
Carl Eugen Hoyos -
Puneet Singh -
Reindl Harald