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

Clip generation fails because of CHAPTER (Invalid data found when processing input) #201

Open
erezzarum opened this issue Oct 23, 2022 · 2 comments

Comments

@erezzarum
Copy link

After generating the intermediate clips the process fails when trying to combine them.
If i comment out using the metadata file and chapter metadata + metadata is works fine.
It seems the issue is related to the chapter generation.
This does not happen when i specify a sentry offset.

2022-10-23 10:02:58,448:DEBUG:	__main__	Video file contains:
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T11-52-36.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T11-53-37.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T11-54-37.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T11-55-37.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T11-56-37.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T11-57-38.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T11-58-38.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T11-59-38.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T12-00-38.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T12-01-39.mp4'
file 'file:/backingfiles/tesla_dashcam/2022-10-21_12-03-29/2022-10-21T12-02-39.mp4'

2022-10-23 10:02:58,449:DEBUG:	__main__	Meta file contains:
;FFMETADATA1
[CHAPTER]
TIMEBASE=1/1000000000
START=0
END=11920000000
title=10/21/22 11:52:36
[CHAPTER]
TIMEBASE=1/1000000000
START=11920000001
END=25300000001
title=10/21/22 11:53:37
[CHAPTER]
TIMEBASE=1/1000000000
START=25300000002
END=39470000002
title=10/21/22 11:54:37
[CHAPTER]
TIMEBASE=1/1000000000
START=39470000003
END=47100000003
title=10/21/22 11:55:37
[CHAPTER]
TIMEBASE=1/1000000000
START=47100000004
END=63060000004
title=10/21/22 11:56:37
[CHAPTER]
TIMEBASE=1/1000000000
START=63060000005
END=80350000005
title=10/21/22 11:57:38
[CHAPTER]
TIMEBASE=1/1000000000
START=80350000006
END=94020000006
title=10/21/22 11:58:38
[CHAPTER]
TIMEBASE=1/1000000000
START=94020000007
END=107560000007
title=10/21/22 11:59:38
[CHAPTER]
TIMEBASE=1/1000000000
START=107560000008
END=117810000008
title=10/21/22 12:00:38
[CHAPTER]
TIMEBASE=1/1000000000
START=117810000009
END=139390000009
title=10/21/22 12:01:39
[CHAPTER]
TIMEBASE=1/1000000000
START=139390000010
END=146390000010
title=10/21/22 12:02:39
@ehendrix23
Copy link
Owner

Can you run it with debug enabled?
Further also provide the actual error output and the complete command (with parameters).

Thx.

@kallioaleksi
Copy link

I'm having a similar issue, here's my debug output:

user@server:/shares/alpha$ tesla_dashcam --monitor --monitor_trigger /shares/alpha/teslacam/ARCHIVE_UPLOADED --skip_existing --delete_source --layout WIDESCREEN --output /shares/alpha/tesla --motion_only --fps 30 --encoding x265 --loglevel DEBUG
2023-11-04 19:56:35,845:DEBUG:	tesla_dashcam.tesla_dashcam	Arguments : Namespace(background='black', chapter_offset=0, check_for_updates=False, clip_scale=None, compression='medium', delete_source=True, encoding='x265', end_offset=None, end_timestamp=None, exclude_subdirs=False, faststart=False, ffmpeg='ffmpeg', font='/usr/share/fonts/truetype/freefont/FreeSans.ttf', fontcolor='white', fontsize=None, fps=30, gpu=False, gpu_type=None, halign=None, include_beta=False, keep_intermediate=False, layout='WIDESCREEN', loglevel='DEBUG', merge_subdirs=False, monitor=True, monitor_once=False, monitor_trigger='/shares/alpha/teslacam/ARCHIVE_UPLOADED', motion_only=True, no_check_for_updates=False, no_front=False, no_left=False, no_rear=False, no_right=False, no_timestamp=False, output='/shares/alpha/tesla', perspective=False, quality='LOWER', rear_or_mirror=None, skip_existing=True, source=[], start_offset=None, start_timestamp=None, swap_frontrear=False, swap_leftright=None, system_notification=True, temp_dir=None, valign=None)
2023-11-04 19:56:35,847:DEBUG:	urllib3.connectionpool	Starting new HTTPS connection (1): api.github.com:443
2023-11-04 19:56:36,174:DEBUG:	urllib3.connectionpool	https://api.github.com:443 "GET /repos/ehendrix23/tesla_dashcam/releases/latest HTTP/1.1" 200 1316
Failed in notifification:  [Errno 2] No such file or directory: 'notify-send': 'notify-send'
New release v0.1.20 is available for download (https://github.com/ehendrix23/tesla_dashcam/releases/tag/v0.1.20). You are currently on v0.1.16. Use --check_for_update to get latest release notes.
2023-11-04 19:56:36,178:DEBUG:	tesla_dashcam.tesla_dashcam	Video Settings {'source_folder': ['SavedClips', 'SentryClips'], 'output': '/shares/alpha/tesla', 'target_folder': '/shares/alpha/tesla', 'target_filename': None, 'temp_dir': None, 'run_type': 'MONITOR', 'merge_subdirs': False, 'chapter_offset': 0, 'movie_filename': None, 'keep_intermediate': False, 'notification': True, 'movie_layout': 'WIDESCREEN', 'movie_speed': '', 'video_encoding': ['-c:v', 'libx265'], 'movie_encoding': 'x265', 'movie_compression': 'medium', 'movie_quality': 'LOWER', 'background': ';color=duration={duration}:s={width}x{height}:c=black, fps=30 ', 'ffmpeg_exec': 'ffmpeg', 'base': 'color=duration={duration}:s=1920x1920:c=black, fps=30 [base]', 'video_layout': <tesla_dashcam.tesla_dashcam.WideScreen object at 0x7f260dfda908>, 'clip_positions': ';[base][left] overlay=eof_action=pass:repeatlast=0:x=0:y=1440 [left1];[left1][front] overlay=eof_action=pass:repeatlast=0:x=0:y=0 [front1];[front1][right] overlay=eof_action=pass:repeatlast=0:x=1280:y=1440 [right1];[right1][rear] overlay=eof_action=pass:repeatlast=0:x=640:y=1440 [rear1]', 'timestamp_text': ";[rear1] drawtext=fontfile=/usr/share/fonts/truetype/freefont/FreeSans.ttf:fontcolor=white:fontsize=48:borderw=2:[email protected]:x=(w/2-text_w/2):y=(h-(text_h*2)):text='%{{pts\\:localtime\\:{epoch_time}\\:%x %X}}' [tmp0]", 'ffmpeg_speed': '', 'ffmpeg_motiononly': ';[tmp0] mpdecimate=hi=64*48, setpts=N/FRAME_RATE/TB [tmp1]', 'movflags_faststart': True, 'input_clip': 'tmp1', 'other_params': ['-preset', 'medium', '-crf', '28', '-c:v', 'libx265', '-metadata', 'description=Created by tesla_dashcam v0.1.16'], 'left_camera': 'setpts=PTS-STARTPTS, scale=640x480 , hflip [left]', 'front_camera': 'setpts=PTS-STARTPTS, scale=1920x1440  [front]', 'right_camera': 'setpts=PTS-STARTPTS, scale=640x480 , hflip [right]', 'rear_camera': 'setpts=PTS-STARTPTS, scale=640x480 , hflip [rear]', 'start_timestamp': None, 'start_offset': 0, 'end_timestamp': None, 'end_offset': 0, 'skip_existing': True}
2023-11-04 19:56:36,179:DEBUG:	tesla_dashcam.tesla_dashcam	Layout Settings <tesla_dashcam.tesla_dashcam.WideScreen object at 0x7f260dfda908>
Monitoring for trigger /shares/alpha/teslacam/ARCHIVE_UPLOADED to exist. Press CTRL-C to stop
Trigger /shares/alpha/teslacam/ARCHIVE_UPLOADED exist.
Failed in notifification:  [Errno 2] No such file or directory: 'notify-send': 'notify-send'
Retrieving all files from:
                          /shares/alpha/teslacam/SavedClips
                          /shares/alpha/teslacam/SentryClips
2023-11-04 19:56:36,180:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam with timestamp SavedClips
2023-11-04 19:56:36,180:DEBUG:	tesla_dashcam.tesla_dashcam	File /shares/alpha/teslacam/SavedClips-front.mp4 does not exist, skipping.
2023-11-04 19:56:36,180:DEBUG:	tesla_dashcam.tesla_dashcam	File /shares/alpha/teslacam/SavedClips-left_repeater.mp4 does not exist, skipping.
2023-11-04 19:56:36,180:DEBUG:	tesla_dashcam.tesla_dashcam	File /shares/alpha/teslacam/SavedClips-right_repeater.mp4 does not exist, skipping.
2023-11-04 19:56:36,180:DEBUG:	tesla_dashcam.tesla_dashcam	File /shares/alpha/teslacam/SavedClips-back.mp4 does not exist, skipping.
Discovered 3 folders containing total of 88 files in /shares/alpha/teslacam/SentryClips
2023-11-04 19:56:36,181:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_20-52-29
2023-11-04 19:56:36,321:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_20-53-29
2023-11-04 19:56:36,457:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_20-54-29
2023-11-04 19:56:36,590:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_20-55-29
2023-11-04 19:56:36,722:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_20-56-29
2023-11-04 19:56:36,857:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_20-57-29
2023-11-04 19:56:36,992:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_20-58-29
2023-11-04 19:56:37,130:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_20-59-30
2023-11-04 19:56:37,268:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_21-00-30
2023-11-04 19:56:37,401:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_21-01-30
2023-11-04 19:56:37,541:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 with timestamp 2023-11-03_21-02-30
2023-11-04 19:56:37,675:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-13-31
2023-11-04 19:56:37,806:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-14-31
2023-11-04 19:56:37,938:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-15-31
2023-11-04 19:56:38,073:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-16-31
2023-11-04 19:56:38,205:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-17-32
2023-11-04 19:56:38,338:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-18-32
2023-11-04 19:56:38,482:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-19-32
2023-11-04 19:56:38,616:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-20-33
2023-11-04 19:56:38,749:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-21-33
2023-11-04 19:56:38,883:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-22-33
2023-11-04 19:56:39,023:DEBUG:	tesla_dashcam.tesla_dashcam	Checking camera files in folder /shares/alpha/teslacam/SentryClips/2023-11-04_00-24-14 with timestamp 2023-11-04_00-23-33
There are 2 folders with 22 clips to process.
2023-11-04 19:56:39,157:DEBUG:	tzlocal	/etc/timezone found, contents:
 Europe/Helsinki

2023-11-04 19:56:39,158:DEBUG:	tzlocal	/etc/localtime found
2023-11-04 19:56:39,161:DEBUG:	tzlocal	2 found:
 {'/etc/timezone': 'Europe/Helsinki', '/etc/localtime is a symlink to': 'Europe/Helsinki'}
	Processing 11 clips in folder /shares/alpha/teslacam/SentryClips/2023-11-03_21-02-42 (1/2)
		Skipping clip 1/11 from 11/03/23 20:52:29 and 59 seconds as it already exist.
		Skipping clip 2/11 from 11/03/23 20:53:29 and 59 seconds as it already exist.
		Skipping clip 3/11 from 11/03/23 20:54:29 and 59 seconds as it already exist.
		Skipping clip 4/11 from 11/03/23 20:55:29 and 59 seconds as it already exist.
		Skipping clip 5/11 from 11/03/23 20:56:29 and 59 seconds as it already exist.
		Skipping clip 6/11 from 11/03/23 20:57:29 and 59 seconds as it already exist.
		Skipping clip 7/11 from 11/03/23 20:58:30 and 59 seconds as it already exist.
		Skipping clip 8/11 from 11/03/23 20:59:30 and 59 seconds as it already exist.
		Skipping clip 9/11 from 11/03/23 21:00:30 and 59 seconds as it already exist.
		Skipping clip 10/11 from 11/03/23 21:01:30 and 59 seconds as it already exist.
		Skipping clip 11/11 from 11/03/23 21:02:30 and 7 seconds as it already exist.
		Creating movie /shares/alpha/tesla/2023-11-03T20-52-29_2023-11-03T21-02-37.mp4, please be patient.
2023-11-04 19:56:40,088:DEBUG:	tesla_dashcam.tesla_dashcam	FFMPEG Command: ['ffmpeg', '-loglevel', 'error', '-f', 'concat', '-safe', '0', '-i', '/tmp/tmp0rk1h5l_.txt', '-i', '/tmp/tmp8ssp1dwa.txt', '-map_metadata', '1', '-map_chapters', '1', '-movflags', '+faststart', '-c', 'copy', '-metadata', 'description=Created by tesla_dashcam v0.1.16', '-y', '/shares/alpha/tesla/2023-11-03T20-52-29_2023-11-03T21-02-37.mp4']
		Error trying to create movie /shares/alpha/tesla/2023-11-03T20-52-29_2023-11-03T21-02-37.mp4. RC: 1
		Command: ['ffmpeg', '-loglevel', 'error', '-f', 'concat', '-safe', '0', '-i', '/tmp/tmp0rk1h5l_.txt', '-i', '/tmp/tmp8ssp1dwa.txt', '-map_metadata', '1', '-map_chapters', '1', '-movflags', '+faststart', '-c', 'copy', '-metadata', 'description=Created by tesla_dashcam v0.1.16', '-y', '/shares/alpha/tesla/2023-11-03T20-52-29_2023-11-03T21-02-37.mp4']
		Error: b'/tmp/tmp8ssp1dwa.txt: Invalid data found when processing input\n'

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

3 participants