简体   繁体   中英

Linux - ffmpeg 3.4.6 vs. 4.2.1 - bash script with Tee (record & stream) runs in older version just fine - what needs to change for new version?

Thanks for reading my post. I have a bash script that I tested and it ran just fine; although I was putting the script into identical hardware as the test computer, I forgot that the target computer would have a newer version of ffmpeg. It should be simple. I'm splitting the signal, recording, and streaming via UDP. Here's the script, that runs just fine with ffmpeg 3.4.6:

ffmpeg -f v4l2 -i /dev/video0 -t 00:30:00 -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf:text='%{localtime\:%T}':x=20:y=20:fontcolor=white" \
-profile:v high -pix_fmt yuvj420p -level:v 4.1 -preset ultrafast -tune \
zerolatency -vcodec libx264 -r 15 -b:v 512k -s 960x720 -f mpegts -flush_packets 0 \
-f tee -map 0:v "/media/dkm/video_usb/videos/video_$(date +%Y-%m-%d_%H.%M.%S).mkv|[f=mpegts]udp://192.168.0.19:5000?pkt_size=1316"

I could try to downgrade, but that doesn't seem right, since that computer is running Linux Mint 19.2 and the original test computer was Ubuntu 18.4 LTS. Is there something basic that I need to change for v. 4.2.1?

I'm hoping that this is a quick fix, since it runs in the old version, but I've learned not to get my hopes up for such things. Any help would be appreciated. I've perused the documentation, but I wasn't able to see anything salient. Thanks in advance!

[tee @ 0x55f91e850f00] Slave 'video.mkv': error writing header: Invalid data found when processing input
[tee @ 0x55f91e850f00] Slave muxer #0 failed, aborting.

You need to add -flags +global_header .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM