Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues accessing audio file during merge - solved #18

Open
eldi0s opened this issue Jan 5, 2025 · 0 comments
Open

Issues accessing audio file during merge - solved #18

eldi0s opened this issue Jan 5, 2025 · 0 comments

Comments

@eldi0s
Copy link

eldi0s commented Jan 5, 2025

Hi,

thanks for your script. I was trying to use it on a Debian 13 (Trixie) system with HomeAssistant Core and MotionEye.

After evaluation of all steps I discovered that everything was working except for merging the audio with the video file.
I did get the error below and the video file did not contain any audio.

[in#1 @ 0x561d16420c80] Error opening input: End of file Error opening input file /var/lib/motioneye/Camera3/2025-01-05/10-09-50.mp4.aac. Error opening input files: End of file mv: der Aufruf von stat für '/var/lib/motioneye/Camera3/2025-01-05/10-09-50.mp4.temp.mp4' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

As audio was working and generating a .wav file when accessing it directly from console with ffmpeg I was thinking about adding a delay before accessing and processing the file may fix it. Et voila. the below "sleep 5" fixed it for me.

stop)
    # Kill the ffmpeg audio recording for the clip
    kill $(cat /tmp/motion-audio-ffmpeg-camera-${camera_id})
    rm -rf $(cat /tmp/motion-audio-ffmpeg-camera-${camera_id})
    # kill $(cat /tmp/motion-audio-ffmpeg-camera-${camera_name})
    # rm -rf $(cat /tmp/motion-audio-ffmpeg-camera-${camera_name})
sleep 5
    # Merge the video and audio to a single file, and replace the original video file
    ffmpeg -y -i ${file_path} -i ${file_path}.aac -c:v copy -c:a copy ${file_path}.temp.${extension};
    mv -f ${file_path}.temp.${extension} ${file_path};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant