but no make difference (seems to me) if work also without the .exe
and however in this case .. do make differences: batch (in my pc) don't work in everycase. But shure ndjamena have modify it to work also in the case of a variable framrate, shure is only a small character or a sintax error, or an error in my script that I cannot identify
+ Reply to Thread
Results 31 to 37 of 37
-
-
marcorocchini , Not too sure what you want to do here but if you want to find the number of frames and use in ffprobe then my last post shows how to find the variable and add it back into your script for ffprobe if you want to use it. What you want ffprobe to show looks confusing to me since there are a lot of variations here.
If you just want to find the number of frames then my first post will do it. It's a pretty simple use of MediaInfo CLI (thats the Command Line version) available at http://mediaarea.net/en/MediaInfo/Download/Windows. The 2 files you need are the Mediainfo.exe (CLI version) and the Mediainfo.dll (from CLI version). Just be sure to follow the punctuation and Capitalization . -
the ndjamena's summarily works, his last to my pc go wrong but it's probably a little thing, maybe the point
Code:if "%% CType =="video"
I think his procedure try to retrive the variabile framerate and puts a conditional. However thanks to bothLast edited by marcorocchini; 2nd Oct 2014 at 13:08.
-
-
Code:
Set /a Count+=1 Set "FOUNDLVL=%STARTLVL%" SetLocal DisableDelayedExpansion set "Audio=v:\automazioneclip\system\empty.wav" if exist "%~dpn1.wav" set "Audio=%~dpn1.wav" rem #### Find TimeCode Info #### Set AUCount=0; Set VDCount=0; Set STCount=0; Set "V_Number_Of_Frames=" for /f "tokens=1,2 delims=^=" %%g in ('v:\automazioneclip\virtualdub\FFProbe -hide_banner -loglevel fatal -pretty -show_format -show_streams "%~f1" 2^>^&1') DO ( CALL :Process_Item "%%~g" "%%~h" ) if NOT "%V_Time_Base%"=="" ( for /F "tokens=1,2 delims=/" %%g in ("%V_Time_Base%") do ( set "V_Time_Base_Denom=%%~g" set /a "V_Time_Base_Num=%%~h*10000" ) ) if NOT "%V_Frame_Rate%"=="" ( for /F "tokens=1,2 delims=/" %%g in ("%V_Frame_Rate%") do ( set /a "V_Frame_Rate_Num=%%~g*10000" set "V_Frame_Rate_Denom=%%~h" ) ) if "%V_Number_Of_Frames%"=="" Set /a "V_Number_Of_Frames=V_Duration/((V_Time_Base_Num/V_Time_Base_Denom)/(V_Frame_Rate_Num/V_Frame_Rate_Denom))" set "FPSforVirtualdub=%V_Number_Of_Frames%" echo "%FPSforVirtualdub%" goto :eof :Process_Item <item_field> <item_data> if "%~2"=="N/A" goto :eof if "%~1"=="[/STREAM]" ( set "CType=" goto :eof ) if "%~1"=="[/FORMAT]" ( set "CType=" goto :eof ) if "%~1"=="[FORMAT]" ( set "CType=FORMAT" goto :eof ) if "%~1"=="index" Set "cur_index=%~2" if "%~1"=="codec_name" Set "cur_codec=%~2" if "%~1"=="codec_type" ( if "%~2"=="audio" ( set /a AUCount+=1 set "CType=audio" ) if "%~2"=="video" if NOT "%cur_codec%"=="mjpeg" ( Set /a VDCount+=1 set "CType=video" ) if "%~2"=="subtitle" ( Set /a STCount+=1 set "CType=subtitle" ) goto :eof ) if "%CType%"=="FORMAT" ( if "%~1"=="TAG:company_name" set "T_Company_Name=%~2" if "%~1"=="TAG:product_name" set "T_Product_Name=%~2" if "%~1"=="TAG:product_version" set "T_Product_Version=%~2" if "%~1"=="TAG:timecode" set "TIMECODE=%~2" goto :eof ) if "%CType%"=="video" ( if %VDCount% GTR 1 ( echo Multiple Video Streams!!!! pause ) if "%~1"=="time_base" set "V_Time_Base=%~2" if "%~1"=="r_frame_rate" set "V_Frame_Rate=%~2" if "%~1"=="duration_ts" set "V_Duration=%~2" if "%~1"=="width" set "V_Width=%~2" if "%~1"=="height" set "V_Height=%~2" if "%~1"=="sample_aspect_ratio" set "V_PAR=%~2" if "%~1"=="nb_frames" set "V_Number_Of_Frames=%~2" goto :eof ) goto :eof
Last edited by ndjamena; 2nd Oct 2014 at 21:18.
-
but it work, and recognize time base and other info, absolutly considerable! with 15/20 file of various type seems work well
big thanks. If I'm not wrong, it do a real count of frames into a video file -
Best method (direct)
Best method:
Cmd ->
ffprobe.exe -v error -select_streams v:0 -show_entries stream=r_frame_rate,duration -of default=nw=1 "d:\movies\The.Matrix.1999.1080p.BrRip.x264.YIFY.d ut.mp4"
Result ->
r_frame_rate=24000/1001
duration=8177.794625
Calculation ->
Frames=24000/1001*8177.794625=196071
Proof ->
ffmpeg -i "d:\movies\The.Matrix.1999.1080p.BrRip.x264.YIFY.d ut.mp4" -f null /dev/null
ffmpeg version N-92938-g0aaaca25e0-ffmpeg-windows-pacman Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.2.0 (GCC)
configuration: --pkg-config=pkg-config --pkg-config-flags=--static --extra-version=ffmpeg-windows-pacman --enable-version3 --disable-debug --disable-w32threads --arch=x86_64 --target-os=mingw32 --cross-prefix=/opt/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --enable-libcaca --enable-gray --enable-libtesseract --enable-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray --enable-libbs2b --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libzimg --enable-libzvbi --enable-libmysofa --enable-libaom --enable-libopenjpeg --enable-libopenh264 --enable-liblensfun --enable-nvenc --enable-nvdec --extra-libs=-lm --extra-libs=-lpthread --extra-cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCACA_STATIC --enable-amf --enable-libmfx --enable-gpl --enable-avisynth --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxavs --enable-avresample --extra-cflags='-march=core2' --extra-cflags=-O2 --enable-static --disable-shared --prefix=/opt/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32 --enable-nonfree --enable-decklink --enable-libfdk-aac
libavutil 56. 25.100 / 56. 25.100
libavcodec 58. 43.100 / 58. 43.100
libavformat 58. 25.100 / 58. 25.100
libavdevice 58. 6.101 / 58. 6.101
libavfilter 7. 47.100 / 7. 47.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'd:\movies\The.Matrix.1999.1080p.BrRip.x264.YIFY.d ut.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.25.100
Duration: 02:16:17.91, start: 0.000000, bitrate: 2497 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x800 [SAR 1:1 DAR 12:5], 2397 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 93 kb/s (default)
Metadata:
handler_name : GPAC ISO Audio Handler
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to '/dev/null':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.25.100
Stream #0:0(und): Video: wrapped_avframe, yuv420p, 1920x800 [SAR 1:1 DAR 12:5], q=2-31, 200 kb/s, 23.98 fps, 23.98 tbn, 23.98 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.43.100 wrapped_avframe
Stream #0:1(und): Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s (default)
Metadata:
handler_name : GPAC ISO Audio Handler
encoder : Lavc58.43.100 pcm_s16le
HERE!!! ->
frame=196071 fps=331 q=-0.0 Lsize=N/A time=02:16:17.90 bitrate=N/A speed=13.8x
video:102631kB audio:1408772kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
shareeditdeleteflag
https://www.facebook.com/Pacman-Graphics-1601114056700700/
https://www.facebook.com/gerard.wensink
gerardwensink@gmail.com
https://www.youtube.com/watch?v=W7_udMM_yHU&list=PLkcSmJZ4L--v6Lz6TfVITbj09mQS5a8FP