Dahua should make a default option and change the file type at the time of export, just a suggestion
Typo maybe?
ffmpeg -y -i video.dav .dav -vcodec libx264 -crf 24 -movflags +faststart video.mp4
should read
ffmpeg -y -i video.dav -vcodec libx264 -crf 24 -movflags +faststart video.mp4
Still no audio for me on:
ffmpeg version 4.1.1-0york1~18.04 Copyright (c) 2000-2019 the FFmpeg developersbuilt with gcc 7 (Ubuntu 7.3.0-27ubuntu1~18.04)configuration: --prefix=/usr --extra-version='0york1~18.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-nonfree --enable-libfdk-aac --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-sharedlibavutil 56. 22.100 / 56. 22.100libavcodec 58. 35.100 / 58. 35.100libavformat 58. 20.100 / 58. 20.100libavdevice 58. 5.100 / 58. 5.100libavfilter 7. 40.101 / 7. 40.101libavresample 4. 0. 0 / 4. 0. 0libswscale 5. 3.100 / 5. 3.100libswresample 3. 3.100 / 3. 3.100libpostproc 55. 3.100 / 55. 3.100ffmpeg is updated, but might need to update a dependency.
ffmpeg -y -i "16.24.14-16.24.33[M][0@0][0].dav" -c:a copy -vcodec libx264 -crf 24 "16.24.14-16.24.33[M][0@0][0].mp4"
ffmpeg version 4.2.1-0york0~18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix=/usr --extra-version='0york0~18.04.1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-nonfree --enable-libfdk-aac --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, dhav, from '16.24.14-16.24.33[M][0@0][0].dav':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: hevc (Main), yuvj420p(pc, bt470bg/bt470bg/bt709), 2688x1520, 20 fps, 100 tbr, 1k tbn
Stream #0:1: Audio: aac (LC), 48000 Hz, mono, fltp
Stream mapping:
Stream #0:0 -> #0:0 (hevc (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
test.dav: Invalid data found when processing input
ffmpeg -loglevel debug -y -i test.dav -c:a copy -vcodec libx264 -crf 24 test.mp4
ffmpeg version 4.2.1-2~18.04.sav0 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
...
Last message repeated 2 times
[hevc @ 0x55619b5440c0] Output frame with POC 374.
[hevc @ 0x55619b5440c0] Decoded frame with POC 374.
test.dav: Invalid data found when processing input
[out_0_0 @ 0x55619bbdf700] EOF on sink link out_0_0:default.bitrate= 287.0kbits/s dup=49 drop=0 speed=0.777x
No more output streams to write to, finishing.
frame= 579 fps= 20 q=-0.0 Lsize= 1061kB time=00:00:23.04 bitrate= 377.2kbits/s dup=49 drop=0 speed=0.793x
video:796kB audio:247kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 1.716234%
Input file #0 (test.dav):
Input stream #0:0 (video): 530 packets read (503353 bytes); 530 frames decoded;
Input stream #0:1 (audio): 990 packets read (253350 bytes);
Total: 1520 packets (756703 bytes) demuxed
Output file #0 (test.mp4):
Output stream #0:0 (video): 579 frames encoded; 579 packets muxed (814686 bytes);
Output stream #0:1 (audio): 990 packets muxed (253350 bytes);
Total: 1569 packets (1068036 bytes) muxed
530 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x55619b497540] Statistics: 2 seeks, 8 writeouts
x265 [info]: frame I: 3, Avg QP:18.51 kb/s: 27240.40
x265 [info]: frame P: 121, Avg QP:27.26 kb/s: 472.74
x265 [info]: frame B: 455, Avg QP:31.63 kb/s: 51.76
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 3.2% 4.0% 2.4% 3.2% 87.1%
encoded 579 frames in 29.01s (19.96 fps), 280.61 kb/s, Avg QP:30.65
[AVIOContext @ 0x55619b42dfc0] Statistics: 830866 bytes read, 0 seeks
Press [Enter] to quit.
ffmpeg -i rtsp:/${RTSPURL} -c copy -flags +global_header -map 0 -f mp4 -movflags frag_keyframe+empty_moov \
-f segment -segment_time ${DURATION} -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 \
-segment_format mp4 "${FP}/${DT}/${LOC}_${DT}_${TS}.mp4"
ffmpeg -i rtsp:/${RTSPURL} -c copy -flags +global_header -map 0 -f mp4 -movflags frag_keyframe+empty_moov \
-f segment -segment_time ${DURATION} -segment_atclocktime 1 -reset_timestamps 1 -strftime 1 \
-segment_format mp4 "${FP}/${DT}/${LOC}_${DT}_${TS}.mp4" -f image2 -vf fps=fps=1/60 -strftime 1 \
"${TFP}/thumbs/${LOC}/${DT}/${LOC}_${DT}_${TS}.jpg"
LOC=frontdoor
FP=/var/site/cameras/${LOC}
TFP=/var/site/cameras
DURATION=600
DT="%Y-%m-%d"
TS="%H-%M-%S"