Opened 19 months ago

Closed 19 months ago

Last modified 19 months ago

#5402 closed defect (invalid)

strftime %l pattern doesn't work on Windows build ( works on OSX just fine )

Reported by: sadensmol Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: drawtext win
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

The following strftime pattern doesn't work on Windows platform:
%l : %M %p

it should show 1 digit hour ( %l ) as first symbol. If I replace it with %I ( 2 digit ) it works fine!
%l works on OSX just fine.

How to reproduce:

I use the following command line ( splitted by , ):

-i,(19).ASF,-bsf:v,h264_mp4toannexb,-f,mpegts,-t,3.2839843749999997,-an,-r,30,-c:v,mpeg4,-flags:v,+qscale,-global_quality:v,0,-vf,scale=1920:1080,drawtext= text=\'%{pts\:localtime\:1454166040\:'%Y-%m-%d'}\': bordercolor=black@0.5:borderw=4:fontfile=\'arial.ttf\':fontcolor=0xFFFFFF@1:x=w*0.0125:y=h*0.916-th:fontsize=66,drawtext= text=\'%{pts\:localtime\:1454166040\:'%l\:%M%p'}\': bordercolor=black@0.5:borderw=4: fontfile=\'arial.ttf\': fontcolor=0xFFFFFF@1:x=w*0.0125:y=h*0.975-th:fontsize=66,qYKocvopL0_tmp.tmp

the main problem here is the following part:
drawtext= text=\'%{pts\:localtime\:1454166040\:'%l\:%M%p'}\':

%l doesn't work as expexted on Windows platform

I tried all windows static builds versions from ffmpeg-2.8.6-win32-static.7z
And it doesn't work on any up to the current one.

Change History (5)

comment:1 Changed 19 months ago by cehoyos

  • Component changed from ffmpeg to undetermined
  • Priority changed from important to normal

Aren't you just reporting a deficiency of the Windows C runtime?

To make this a valid ticket please test current FFmpeg git head and provide a simplified command line that allows to reproduce the issue together with the complete, uncut console output.

comment:2 Changed 19 months ago by sadensmol

I don't really know what this bug is related to,but i see in docs that time pattern should be passed in strftime format. Which doesn't work well.
If I can pass time pattern in any other format just let me know and i will rework my code without looking for the fix from your side.

Please find test code on this link ( including the latest version of ffmpeg and 2 test .bat files one with %l and second with %I ).

https://www.dropbox.com/s/zkd9owofur70xp2/222.ZIP?dl=0

Console output:

d:\222>ffmpeg.exe -i test.mp4 -an -vf drawtext="fontfile=arial.ttf:fontsize=66:text='%{localtime\:%a %d %Y %l %M %p}'" out.wmv
ffmpeg version N-78313-g6632802 Copyright (c) 2000-2016 the FFmpeg developers

built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab

le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --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-d
ecklink --enable-zlib

libavutil 55. 17.100 / 55. 17.100
libavcodec 57. 24.101 / 57. 24.101
libavformat 57. 24.100 / 57. 24.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 28.100 / 6. 28.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':

Metadata:

major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2016-01-12 16:29:33
com.apple.quicktime.location.ISO6709: +54.7688+032.0377+251.742/
com.apple.quicktime.make: Apple
com.apple.quicktime.model: iPhone 6
com.apple.quicktime.software: 9.2
com.apple.quicktime.creationdate: 2016-01-12T19:29:32+0300

Duration: 00:00:30.95, start: 0.000000, bitrate: 17172 kb/s

Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 17081 kb/s, 29.98 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
Metadata:

rotate : 90
creation_time : 2016-01-12 16:29:33
handler_name : Core Media Data Handler
encoder : H.264

Side data:

displaymatrix: rotation of -90.00 degrees

Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 81 kb/s (default)
Metadata:

creation_time : 2016-01-12 16:29:33
handler_name : Core Media Data Handler

Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
Metadata:

creation_time : 2016-01-12 16:29:33
handler_name : Core Media Data Handler

Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
Metadata:

creation_time : 2016-01-12 16:29:33
handler_name : Core Media Data Handler

Output #0, asf, to 'out.wmv':

Metadata:

major_brand : qt
minor_version : 0
compatible_brands: qt
com.apple.quicktime.creationdate: 2016-01-12T19:29:32+0300
com.apple.quicktime.location.ISO6709: +54.7688+032.0377+251.742/
com.apple.quicktime.make: Apple
com.apple.quicktime.model: iPhone 6
com.apple.quicktime.software: 9.2
WM/EncodingSettings: Lavf57.24.100
Stream #0:0(und): Video: msmpeg4v3 (msmpeg4) (MP43 / 0x3334504D), yuv420p, 1080x1920, q=2-31, 200 kb/s, 29.97 fps, 1k tbn, 29.97 tbc (default)
Metadata:

handler_name : Core Media Data Handler
creation_time : 2016-01-12 16:29:33
encoder : Lavc57.24.101 msmpeg4

Side data:

unknown side data type 10 (24 bytes)

Stream mapping:

Stream #0:0 -> #0:0 (h264 (native) -> msmpeg4v3 (msmpeg4))

Press [q] to stop, ? for help
frame= 928 fps=3.5 q=31.0 Lsize= 12848kB time=00:00:30.96 bitrate=3399.1kbits/s
video:12722kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.990210%

comment:3 Changed 19 months ago by cehoyos

  • Component changed from undetermined to avfilter
  • Keywords win added
  • Resolution set to invalid
  • Status changed from new to closed

https://msdn.microsoft.com/en-us/library/fe06s4ak.aspx
Please reopen this ticket if anything in the FFmpeg documentation indicates that %l is supposed to work everywhere. (I think the exact opposite is correctly documented.)

comment:4 Changed 19 months ago by sadensmol

Thank you for the update. I got this but still has no solution for 12-hour with no leading zero format.

Can you please indicate in ffmpeg docs that strftime is platform specific function ( even compiled with GCC ) or so to avoid such tickets in future.

comment:5 Changed 19 months ago by cehoyos

Afaict, the option is marked as deprecated usually meaning you get no or very limited support (including documentation) anyway: Additionally, it explains to read the documentation of strftime - I think it is obvious that only the platform-specific information can be meant.

Note: See TracTickets for help on using tickets.