[FFmpeg-trac] #9210(undetermined:new): Concat images produces wrong timings when duration is in milliseconds
FFmpeg
trac at avcodec.org
Mon Dec 6 14:01:35 EET 2021
#9210: Concat images produces wrong timings when duration is in milliseconds
-------------------------------------+-------------------------------------
Reporter: demet64 | Owner: (none)
Type: defect | Status: new
Priority: normal | Component:
| undetermined
Version: unspecified | Resolution:
Keywords: concat | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by Andre LaBranche):
The unwanted 25 fps does seem to be coming from `concat`. I tested that
along with `image2` and found that `image2` honors the frame rate passed
as a cli option.
Here's a script that creates some sample images, does a concat run and an
image2 run, and collects reports for each.
{{{
#!/bin/zsh
OUT=$(mktemp -d)
CATFILE=${OUT}/catfile.txt
pushd ${OUT}
echo "generating some sample images with Imagemagik's 'convert' tool"
for i in {1..60}
do
IMG=image-$(printf "%03d" ${i}).jpg
convert -size 600x300 -gravity center -background black \
-fill purple label:${i} -units PixelsPerInch -density 254 ${IMG}
echo "file '${IMG}'" >> ${CATFILE}
echo "duration 0.016" >> ${CATFILE}
done
echo "Wrote sample ffmpeg concat input file: ${CATFILE}"
CONCAT_CMD='ffmpeg -f concat -i ${CATFILE} -report concat.mkv 2>
/dev/null'
export FFREPORT=file=ffprobe-concat.log
echo "Probing concat with:\n${CONCAT_CMD}"
eval ${CONCAT_CMD}
echo "Wrote video ${OUT}/concat.mkv"
echo "Reading frame rate of concat.mkv..."
ffprobe -v error -show_format -show_streams concat.mkv | grep 'frame_rate'
IMAGE2_CMD="ffmpeg -f image2 -framerate 60 -i image-%03d.jpg image2.mkv 2>
/dev/null"
echo "\nProbing image2 with:\n${IMAGE2_CMD}"
export FFREPORT=file=ffprobe-image2.log
eval ${IMAGE2_CMD}
echo "Wrote video ${OUT}/image2.mkv"
echo "Reading frame rate of concat.mkv..."
ffprobe -v error -show_format -show_streams image2.mkv | grep 'frame_rate'
echo "\nFull reports for each run: "
ls -1 ${OUT}/ffprobe*.log
open ${OUT}
popd
}}}
When run on my machine, it looks like this:
{{{
andre at boom % ./duration_snooping.sh
generating some sample images with Imagemagik's 'convert' tool
Wrote sample ffmpeg concat input file:
/var/folders/sc/q27bbsbn105gr0d08r3nd2jr0000gn/T/tmp.jAH5RBjv/catfile.txt
Probing concat with:
ffmpeg -f concat -i ${CATFILE} -report concat.mkv 2> /dev/null
Wrote video
/var/folders/sc/q27bbsbn105gr0d08r3nd2jr0000gn/T/tmp.jAH5RBjv/concat.mkv
Reading frame rate of concat.mkv...
r_frame_rate=25/1
avg_frame_rate=25/1
Probing image2 with:
ffmpeg -f image2 -framerate 60 -i image-%03d.jpg image2.mkv 2> /dev/null
Wrote video
/var/folders/sc/q27bbsbn105gr0d08r3nd2jr0000gn/T/tmp.jAH5RBjv/image2.mkv
Reading frame rate of concat.mkv...
r_frame_rate=60/1
avg_frame_rate=60/1
Full reports for each run:
/var/folders/sc/q27bbsbn105gr0d08r3nd2jr0000gn/T/tmp.jAH5RBjv/ffprobe-
concat.log
/var/folders/sc/q27bbsbn105gr0d08r3nd2jr0000gn/T/tmp.jAH5RBjv/ffprobe-
image2.log
}}}
Here are the two reports from the above run:
* https://youbeill.in/scrap/ffprobe-image2.log
* https://youbeill.in/scrap/ffprobe-concat.log
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9210#comment:7>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list