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

merging error #26

Closed
gskvhfk opened this issue Nov 11, 2021 · 9 comments
Closed

merging error #26

gskvhfk opened this issue Nov 11, 2021 · 9 comments

Comments

@gskvhfk
Copy link

gskvhfk commented Nov 11, 2021

I have problem in merging please sort out

C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main>python lives
tream_saver.py merge C:\Users\USER\Downloads\livestream_saver-main\livestream_sa
ver-main\stream_capture_19gEHNEkakM{19gEHNEkakM}
Traceback (most recent call last):
File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 18, in get_metadata_info
with open(path / "metadata.json", 'r', encoding='utf-8') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\USER\Downlo
ads\livestream_saver-main\livestream_saver-main\stream_capture_19gEHNEkakM{19
gEHNEkakM}\metadata.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "livestream_saver.py", line 655, in main
error = args["func"](config, args)
File "livestream_saver.py", line 440, in merge_mode
info = get_metadata_info(data_path)
File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 21, in get_metadata_info
logger.exception(f"Exception while trying to load metadata.json: {e}")
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 1469, in excepti
on
self.error(msg, *args, exc_info=exc_info, **kwargs)
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 1463, in error
self.log(ERROR, msg, args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\logging_init
.py", line 1577, in log
self.handle(record)
File "C:\ProgramData\Anaconda3\lib\logging_init
.py", line 1587, in handle
self.callHandlers(record)
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 1649, in callHan
dlers
hdlr.handle(record)
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 950, in handle
self.emit(record)
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 1182, in emit
self.stream = self.open()
File "C:\ProgramData\Anaconda3\lib\logging_init
.py", line 1172, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\USER\Downlo
ads\livestream_saver-main\livestream_saver-main\stream_capture_19gEHNEkakM{19
gEHNEkakM}\merge.log'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "livestream_saver.py", line 683, in
exit(main())
File "livestream_saver.py", line 660, in main
logger.exception(e)
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 1469, in excepti
on
self.error(msg, *args, exc_info=exc_info, **kwargs)
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 1463, in error
self.log(ERROR, msg, args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\logging_init
.py", line 1577, in log
self.handle(record)
File "C:\ProgramData\Anaconda3\lib\logging_init
.py", line 1587, in handle
self.callHandlers(record)
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 1649, in callHan
dlers
hdlr.handle(record)
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 950, in handle
self.emit(record)
File "C:\ProgramData\Anaconda3\lib\logging_init_.py", line 1182, in emit
self.stream = self.open()
File "C:\ProgramData\Anaconda3\lib\logging_init
.py", line 1172, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\USER\Downlo
ads\livestream_saver-main\livestream_saver-main\stream_capture_19gEHNEkakM{19
gEHNEkakM}\merge.log'

@glubsy
Copy link
Owner

glubsy commented Nov 11, 2021

Your target directory should be stream_capture_19gEHNEkakM not stream_capture_19gEHNEkakM{19gEHNEkakM}.

@gskvhfk
Copy link
Author

gskvhfk commented Nov 11, 2021

Still i am getting error
C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main>python lives
tream_saver.py merge C:\Users\USER\Downloads\livestream_saver-main\livestream_sa
ver-main\stream_capture_19gEHNEkakM
2021-11-11 18:05:32,474 - ERROR - livestream_saver.merge - Exception while tryin
g to load metadata.json: [Errno 2] No such file or directory: 'C:\Users\USER\
Downloads\livestream_saver-main\livestream_saver-main\stream_capture_19gEHNEk
akM\metadata.json'
Traceback (most recent call last):
File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 18, in get_metadata_info
with open(path / "metadata.json", 'r', encoding='utf-8') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\USER\Downlo
ads\livestream_saver-main\livestream_saver-main\stream_capture_19gEHNEkakM\m
etadata.json'
2021-11-11 18:05:32,490 - ERROR - livestream_saver - 'id'
Traceback (most recent call last):
File "livestream_saver.py", line 655, in main
error = args["func"](config, args)
File "livestream_saver.py", line 441, in merge_mode
written_file = merge(
File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 207, in merge
logger = logging.getLogger("download" + "." + info['id'])
KeyError: 'id'

@glubsy
Copy link
Owner

glubsy commented Nov 11, 2021

That is normal if you are missing the metadata.json file that should be in the directory. I'll see if I can patch this to allow merging without the metadata file.

@gskvhfk
Copy link
Author

gskvhfk commented Nov 11, 2021

I TRIED ANOTHER FILE BUT ITS DIFFERENT ERROR

C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main>python livestream_saver.py merge C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\stream_capture_PP0S1T1uvWA
2021-11-11 18:25:35,254 - WARNING - download.PP0S1T1uvWA - Number of audio and video segments do not match.
2021-11-11 18:25:35,271 - ERROR - livestream_saver - [WinError 2] The system can not find the file specified
Traceback (most recent call last):
  File "livestream_saver.py", line 655, in main
    error = args["func"](config, args)
  File "livestream_saver.py", line 441, in merge_mode
    written_file = merge(
  File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 241, in merge
    vid_props = probe(video_files[0])
  File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 171, in probe
    probeproc = subprocess.run(probecmd, capture_output=True, text=True)
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 489, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main>python livestream_saver.py merge C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\stream_capture_19gEHNEkakM
2021-11-11 18:25:51,208 - ERROR - livestream_saver - [WinError 2] The system cannot find the file specified
Traceback (most recent call last):
  File "livestream_saver.py", line 655, in main
    error = args["func"](config, args)
  File "livestream_saver.py", line 441, in merge_mode
    written_file = merge(
  File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 241, in merge
    vid_props = probe(video_files[0])
  File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 171, in probe
    probeproc = subprocess.run(probecmd, capture_output=True, text=True)
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 489, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

@glubsy
Copy link
Owner

glubsy commented Nov 11, 2021

You need to have ffprobe installed on your system. It should be installed alongside ffmpeg usually. No idea how that works on Windows. You need to make sure ffprobe is in your PATH environment variable.

@glubsy
Copy link
Owner

glubsy commented Nov 11, 2021

If for whatever reason you cannot use ffprobe, I just pushed commit 122bc5e which should ignore the error and complete the merge process anyway.
It should also ignore the missing metadata.json file error.
Let me know if you get other errors.

@gskvhfk
Copy link
Author

gskvhfk commented Nov 11, 2021

the video file got merged but audio is not merged it shows error
C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main>python lives
tream_saver.py merge C:\Users\USER\Downloads\livestream_saver-main\livestream_sa
ver-main\stream_capture_19gEHNEkakM
2021-11-11 21:25:49,260 - ERROR - download.19gEHNEkakM - Failed to use ffprobe:
[WinError 2] The system cannot find the file specified.
2021-11-11 21:25:49,284 - ERROR - download.19gEHNEkakM - Failed to use ffprobe:
[WinError 2] The system cannot find the file specified.
2021-11-11 21:25:49,285 - INFO - download.19gEHNEkakM - Trying concatenation met
hod: "concat".
2021-11-11 21:26:04,074 - ERROR - livestream_saver - [WinError 2] The system can
not find the file specified
Traceback (most recent call last):
File "livestream_saver.py", line 655, in main
error = args["func"](config, args)
File "livestream_saver.py", line 441, in merge_mode
written_file = merge(
File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 260, in merge
ffmpeg_output_path_video = concat(
File "C:\Users\USER\Downloads\livestream_saver-main\livestream_saver-main\live
stream_saver\merge.py", line 135, in concat
cproc = subprocess.run(
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 489, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1307, in _execute_chil
d
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

@glubsy
Copy link
Owner

glubsy commented Nov 11, 2021

You need to make sure ffmpeg is in installed, and the path to the program is your PATH.
I'll push a patch to show a more explicit message whenever ffmpeg cannot be found. Commit: 673ad17

@gskvhfk
Copy link
Author

gskvhfk commented Nov 11, 2021

Thanks i downloaded ffmeg and files got merged

@glubsy glubsy closed this as completed Nov 11, 2021
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

2 participants