def startRecording(channel, start, length, episode, show):
tunerInstance = tuneChannel(channel)
sched_cmd = ['at', '-t', start]
command = 'ffmpeg -i /dev/ceton/ctn91xx_mpeg0_%s -c copy -t %s /mnt/primary-backup-drive/Backup/Recordings/%s-%s-%s.mp4' % (tunerInstance, length, show, episode, channel)
p = Popen(sched_cmd, stdin=PIPE)
p.communicate(command)
I am getting the following error with this function:
File "./cetonTune.py", line 70, in startRecording
p.communicate(command)
File "/usr/lib/python3.8/subprocess.py", line 1013, in communicate
self._stdin_write(input)
File "/usr/lib/python3.8/subprocess.py", line 962, in _stdin_write
self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str'
Any help would be greatly appreciated!