-1

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!

  • What is the error? Show the complete log. – llogan Jul 20 '20 at 02:30
  • Hi. Not sure where the complete log is; I was more interested in having someone read the code to see anything stood out as deprecated, etc. The computer is already back in service, but I'll try to post errors later--what I saw seemed boiler plate. In previous posts, I've seen that some people are so familiar with ffmpeg that they know when something has changed with versions and has issues. I thought my question was quite clear, though: What needs to change for new version? It's not a lot of code. Even I recognize most of this stuff from my limited exposure, but I don't see any issues. Thanks! – pomptondrive Jul 21 '20 at 21:23
  • The "log" is not an accurate term, but users tend to understand it more than when I ask for the console output that `ffmpeg` outputs when you run it. Seeing the console output will make finding any issues significantly easier. – llogan Jul 21 '20 at 21:50
  • Yes, console/terminal errors make more sense to me, although there are a lot of Linux apps that seems to have error logs if you know where to find them. ;-) – pomptondrive Jul 23 '20 at 02:21

1 Answers1

0
[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.

llogan
  • 121,796
  • 28
  • 232
  • 243
  • This seems to have done the trick and answered my question. I can tweak, but I don't have the in-depth knowledge that some of you guys do. I had seen something in my research about the +global_header, but others seemed to think it wasn't necessary. Thanks much. The last two questions I posted, I deleted because I eventually found my own answer, so let me know if I need to add something here to give you credit. Thanks again! – pomptondrive Jul 23 '20 at 02:19