Hello, I have an issue where ffmpeg does not convert an appropriate file for a webserver.
Here's the setup: we are running a video webserver via xampp hosting a file that is continuously renewed by a command line loop.
- The loop takes from an old TVT-CMS software that continously makes .dat files.
- The loop moves them to the "hova" folder and moves around other files (deleting old files) before finally moving them to a "konvert" folder.
- Here ffmpeg is ran to convert the file into a widely-compatible .mp4 file. This is where my problem is.
- Once the .mp4 file is converted, it is done. The webserver refers to it and the video is accessible.
Sample file:
https://drive.google.com/open?id=1GmKw4usndKt4QLxPMU7amY9WmfLCqf2n
Here are the command lines:
The initiator and looping command:
The converter file:rem @echo off
set konyvtar=C:\RecData79fc08a97cef4cb781f20b515debcac 7\
set kam1=0018ae3f302400
set kam1_dat=@
set hova=c:\xampp\htdocs\kamera\vid\honnan
set tid=
set kam1_time=0
call torol.bat %konyvtar%%kam1%
rem töröljük a nem szükséges videókat
for /f "skip=3" %%G IN ('dir /b /a-d /o-d "%konyvtar%%kam1%"') DO del %konyvtar%%kam1%\%%G
for /F "tokens=2 delims= " %%A IN ('tasklist /FI ^"imagename eq cmd.exe^" /NH ') DO (
set tid=%%A
goto again
)
rem timeout /t 30
:again
set /A cou=1
:loop
echo %cou%
ping 1.1.1.1 -n 1 -w 6000 > nul
rem timeout /t %kam1_time%
del /F %hova%\*.dat
set line=
for /f "skip=1" %%G IN ('dir /b /a-d /o-d "%konyvtar%%kam1%"') DO if not defined line set "line=%%G"
rem pause
if %kam1_dat% neq %line% (
set "kam1_dat=%line%"
start konvert-576p.bat %konyvtar%%kam1%\%line% %hova% %line% kam1
set kam1_time=6
)
timeout /t 30
if %cou%==300 (
call taskkill /F /IM cmd.exe /FI ^"PID ne %tid%^" /T
timeout /t 12
for /R "c:\xampp\htdocs\kamera\vid\VirtualDub\" %%I IN ("vdsub.zip") DO (
"c:\Program Files\7-Zip\7z.exe" x -y -o"%%~dpI" "%%~fI"
)
for /f "skip=3" %%G IN ('dir /b /a-d /o-d "%konyvtar%%kam1%"') DO del %konyvtar%%kam1%\%%G
goto again
) ELSE (
set /A cou+=1
goto loop
)
timeout /t 30
This is the ffmpeg report:copy /Y %1 %2
set gg=%3
set mit=%gg:~0,14%
vid\ff\bin\ffmpeg -f h264 -y -t 00:01:00 -i vid\honnan\%mit%.dat -s 1280x720 -fs 50000000 -preset ultrafast -report %2\%4.mp4
move %2\%4.mp4 vid\konvert
del /F vid\honnan\%mit%.*
rem pause
exit
Bolding is mine.ffmpeg started on 2019-06-03 at 10:11:08
Report written to "ffmpeg-20190603-101108.log"
Command line:
"vid\\ff\\bin\\ffmpeg" -f h264 -y -t 00:01:00 -i "vid\\honnan\\20190530002755.dat" -s 1280x720 -fs 50000000 -preset ultrafast -report "c:\\xampp\\htdocs\\kamera\\vid\\honnan\\kam1. mp4"
ffmpeg version n3.1.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --arch=x86 --target-os=mingw32 --cross-prefix=/home/rdp/dev/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32- --pkg-config=pkg-config --disable-w32threads --enable-libsoxr --enable-fontconfig --enable-libass --enable-libbluray --enable-iconv --enable-libtwolame --extra-cflags=-DLIBTWOLAME_STATIC --enable-libzvbi --enable-libcaca --enable-libmodplug --extra-libs=-lstdc++ --extra-libs=-lpng --enable-decklink --extra-libs=-loleaut32 --enable-libmp3lame --enable-version3 --enable-zlib --enable-librtmp --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libopenjpeg --enable-gnutls --enable-libgsm --enable-libfreetype --enable-libopus --enable-bzlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-libschroedinger --enable-libvpx --enable-libilbc --enable-libwavpack --enable-libwebp --enable-libgme --enable-dxva2 --enable-avisynth --enable-gray --enable-libopenh264 --enable-nvenc --enable-libebur128 --enable- libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Splitting the commandline.
Reading option '-f' ... matched as option 'f' (force format) with argument 'h264'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '00:01:00'.
Reading option '-i' ... matched as input file with argument 'vid\honnan\20190530002755.dat'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '1280x720'.
Reading option '-fs' ... matched as option 'fs' (set the limit file size in bytes) with argument '50000000'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'ultrafast'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option 'c:\xampp\htdocs\kamera\vid\honnan\kam1.mp4' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file vid\honnan\20190530002755.dat.
Applying option f (force format) with argument h264.
Applying option t (record or transcode "duration" seconds of audio/video) with argument 00:01:00.
Successfully parsed a group of options.
Opening an input file: vid\honnan\20190530002755.dat.
[file @ 049e1280] Setting default whitelist 'file,crypto'
vid\honnan\20190530002755.dat: No such file or directory
In the past, this command line worked. Then the server machine died and has been replaced. I have managed to restore the original conditions as much as possible.
I am also open to using another program that could monitor an IPC camera and make a continuously refreshed .mp4 file through other methods. Ideally, it should be winXP compatible but I am willing to upgrade to windows 7 if it gurantees that it works.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 3 of 3
Thread
-
-
Insert these lines after the call to FFmpeg in the converter script.
Code:echo **************** dir %mit% echo **************** exit /b
-
Yes, it writes out that the file is not found. Which is strange because the batch file starts out by telling me that it has successfully copied out the necessary file. Then the two set commands (gg and mit) then ffmpeg starts. Then the file somehow disappears for ffmpeg and the echo commands you told me to add tells me that the files are not found. The file even disappears if I manually copy it to the "honnan" directory.
What am I doing wrong?
Similar Threads
-
How to generate TSMuxer .meta file with command line?
By midts in forum Video ConversionReplies: 7Last Post: 6th May 2019, 07:37 -
Software to convert editing operations to the command line ffmpeg
By ctimict in forum EditingReplies: 2Last Post: 20th Feb 2019, 14:02 -
ffmpeg not work on two command vignete and blur in one line , why ?
By dedekov in forum EditingReplies: 7Last Post: 20th Mar 2018, 09:09 -
command line util that returns video file info?
By wallywalters in forum Newbie / General discussionsReplies: 6Last Post: 19th Jan 2017, 20:57 -
ffmpeg command line syntax
By sambat in forum Newbie / General discussionsReplies: 2Last Post: 14th Dec 2016, 20:01