OK,
It's not a ffmpeg-only one-liner but it gets the job done :)
Thank You Richard.
W dniu 2025-02-26 o 00:10, Richard Bartczak via ffmpeg-user pisze:
There are fatal errors in the stream.
I did check it with a script (Linux) :
---
[...]
---
It leads to the missing audio after this error.
This error must be removed to reencode :
ffmpeg -i "test.mp4" -codec copy -ss 00:00:00.000 -t 00:00:14.950
"test1.mp4"
ffmpeg -i "test.mp4" -codec copy -ss 00:00:16.510 -t 00:00:50.080
"test2.mp4"
But to "cat" the files via ffmpeg, all errors must be removed :
All mp4 files of the directory will be "cat"
ffmpeg -safe 0 -f concat -i <(printf "file '$PWD/%s'\n" *.mp4) -c copy
test.mp4
But with Avidemux you can ad all videos per drag + drop, after all, save
the files in copy mode to one-mp4 and reencode as you wish.
The script to get all errors with the respective timestamp :
#!/bin/bash
while IFS= read -r -d $'\0' video
do
filename=$(basename -- "$video")
filename="${filename%.*}"
ffmpeg -y -i "$video" -vcodec libx264 -crf 51 -preset ultrafast
-acodec copy -f mp4 -movflags frag_keyframe+empty_moov+delay_moov pipe:1
>/dev/null 2>"${filename}.txt" </dev/null
TxtFileName="${filename}.txt"
mystring=${TxtFileName}
echo $mystring
grep -i -n 'error\|duplicate\|failure\|missing\|POCs\|corrupt'
"${TxtFileName}"
echo "Ready"
done < <(find -iregex ".*\.\(mp4\|mkv\|m2ts\|mpg\|ts\)" -print0)
#dos2unix -c mac "${TxtFileName}"
#grep -C 5 -i -n 'error\|duplicate\|failure' "${TxtFileName}"
echo "Ready"
read pause
All video files of the directory will be checked, the result you will
find in the txt-file.
Regards
Am 25.02.25 um 03:02 schrieb BloodMan:
Hello,
wetransfer mp4 test file: https://we.tl/t-BJKuiAHTKQ
The video plays using VLC with glitches and drops (with sound until
the end) but reencoding generally failed (silence after the first drop).
How to survive? How to reencode with "ignore errors like play in vlc"?
I tested many ffmpeg commands and tricks and nothing :/
Anyone?
ps. ffmpeg from git (N-118536-g4ff1d1f3d6) of course
--
BloodMan,
_______________________________________________
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".