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

bug or command line option problem? #4

Open
thx4ever opened this issue Jun 11, 2021 · 4 comments
Open

bug or command line option problem? #4

thx4ever opened this issue Jun 11, 2021 · 4 comments
Assignees

Comments

@thx4ever
Copy link

thx4ever commented Jun 11, 2021

Hi, i'm trying this program to encode in parallel but any python version trow a error, maybe my command line options have problem or no, so here it is

av1transcoder E:\PB[S01E01].m2ts --dump-commands=yes --outputdir=/users/administrator/desktop/tmp --temp-dir=/users/administrator/desktop/tmp -k --global-parameters="init_hw_device cuda -c:v h264_cuvid" --encoder-parameters="-pix_fmt yuv420p10le -cpu-used 0 -crf 25 -frame-parallel 0 -threads 1 -auto-alt-ref 1 -lag-in-frames 25 -enable-cdef 1-enable-global-motion 1 -enable-intrabc 1" --ffmpeg ffmpeg.exe --ffprobe ffprobe.exe --ffmpeg-base "/encbin"

File "c:\program files\python37\lib\site-packages\av1transcoder\input_file.py"
, line 97, in _parse_time_base
first, second = map(int, node_content.split("/"))
AttributeError: 'NoneType' object has no attribute 'split'

Regards

@luziferius
Copy link
Owner

luziferius commented Jun 11, 2021

Thanks for the notification!

It seems that ffmpeg broke it’s XML output format. I tested it and the stream nodes in the ffprobe output miss a timer-related attribute the program expects to be there.…

I’ll release a fix so that it works on recent ffmpeg versions again.

@luziferius
Copy link
Owner

luziferius commented Jun 11, 2021

Version 0.4.2 released and pushed to PyPI

This version works for me with a recent, self-compiled ffmpeg, so it should fix the incompatibility.

@luziferius luziferius self-assigned this Jun 11, 2021
@thx4ever
Copy link
Author

Thanks, can u add libvpx-vp9 support? Regards

@thx4ever
Copy link
Author

PS C:> av1transcoder E:\PB[S01E01].m2ts --dump-commands yes --output-dir=/users/administrator/desktop --temp-dir=/users
/administrator/desktop/tmp -k --global-parameters="-init_hw_device cuda -c:v h264_cuvid" --encoder-parameters="-pix_fmt
yuv420p10le -cpu-used 4 -crf 25 -frame-parallel 0 -threads 1 -auto-alt-ref 1 -lag-in-frames 25 -enable-cdef 1 -enable-gl
obal-motion 1 -enable-intrabc 1" --ffmpeg ffmpeg.exe --ffprobe ffprobe.exe --ffmpeg-base "/encbin"
2021-06-11 11:23:06,657 INFO - av1transcoder.input_file - Extracting file data for all input files.
2021-06-11 11:23:06,657 INFO - av1transcoder.input_file - Determined output directory for input file "E:\PB[S01E01].m2ts
". Data will be written to "C:\Users\Administrator\Desktop"
2021-06-11 11:23:06,658 INFO - av1transcoder.input_file - Determined temporary directory for input file "E:\PB[S01E01].m
2ts". Data will be written to "C:\Users\Administrator\Desktop\tmp\PB[S01E01].m2ts.temp"
2021-06-11 11:23:06,658 INFO - av1transcoder.ffmpeg_handler - To be used ffmpeg/ffprobe binaries based on parameters: FF
mpeg(ffmpeg='C:\encbin\ffmpeg.exe', ffprobe='C:\encbin\ffprobe.exe')
2021-06-11 11:23:06,659 INFO - av1transcoder.input_file - Collecting file data (streams and chapters) for input file: E:
\PB[S01E01].m2ts
2021-06-11 11:23:06,659 INFO - av1transcoder.input_file - Start extracting file data for input file: E:\PB[S01E01].m2ts
2021-06-11 11:23:06,659 INFO - av1transcoder.input_file - Running ffprobe to probe input file. Using parameters: ['ffpro
be', '-hide_banner', '-loglevel', 'error', '-show_chapters', '-show_streams', '-print_format', 'xml', '--', 'E:\PB[S01E
01].m2ts']
2021-06-11 11:23:06,777 INFO - av1transcoder.input_file - Extracted data. Required XML elements present in extracted dat
a: Chapters: True, Streams: True
2021-06-11 11:23:06,778 INFO - av1transcoder.input_file - Extracting chapter data for input file: E:\PB[S01E01].m2ts
2021-06-11 11:23:06,778 INFO - av1transcoder.input_file - Extracting stream data for input file: E:\PB[S01E01].m2ts
2021-06-11 11:23:06,778 INFO - av1transcoder.input_file - Handling output directory creation for input file "E:\PB[S01E0
1].m2ts": C:\Users\Administrator\Desktop
2021-06-11 11:23:06,778 INFO - av1transcoder.input_file - Handling temporary directory creation for input file "E:\PB[S0
1E01].m2ts": C:\Users\Administrator\Desktop\tmp\PB[S01E01].m2ts.temp
2021-06-11 11:23:06,779 INFO - av1transcoder.scene_cuts - Searching the input file "E:\PB[S01E01].m2ts" for scene change
s.
2021-06-11 11:23:06,779 INFO - av1transcoder.scene_cuts - Constructing command line to detect scene cuts in input file "
<InputFile:
InputFile: E:\PB[S01E01].m2ts
OutputDir: C:\Users\Administrator\Desktop
Streams: [<Stream: stream_id: 0, start_time: 1.441711, duration: 2621.6187, format_name: h264, names: {}>]
Chapters: []

"
2021-06-11 11:23:06,780 INFO - av1transcoder.scene_cuts - Created SceneCutDetectionCommandLine instance.
2021-06-11 11:23:06,780 INFO - av1transcoder.command_line - Running command line: ['C:\encbin\ffmpeg.exe', '-hide_bann
er', '-init_hw_device', 'cuda', '-c:v', 'h264_cuvid', '-n', '-i', 'E:\PB[S01E01].m2ts', '-vf', "select='gt(scene,0.3)',
metadata=print:file='C:\Users\Administrator\Desktop\tmp\PB[S01E01].m2ts.temp\in_progress_scenes\raw_timestamps.tx
t',null", '-an', '-sn', '-f', 'null', '-']
Input #0, mpegts, from 'E:\PB[S01E01].m2ts':
Duration: 00:43:41.62, start: 1.441711, bitrate: 31876 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9],
23.98 fps, 23.98 tbr, 90k tbn
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
[metadata @ 0000000008560400] [Eval @ 000000000031e010] Undefined constant or missing '(' in 'UsersAdministratorDesktopt
mpPB[S01E01].m2ts.tempin_progress_scenesraw_timestamps.txt'
[metadata @ 0000000008560400] Unable to parse option value "UsersAdministratorDesktoptmpPB[S01E01].m2ts.tempin_progress_
scenesraw_timestamps.txt"
[metadata @ 0000000008560400] [Eval @ 000000000031df30] Undefined constant or missing '(' in 'UsersAdministratorDesktopt
mpPB[S01E01].m2ts.tempin_progress_scenesraw_timestamps.txt'
[metadata @ 0000000008560400] Unable to parse option value "UsersAdministratorDesktoptmpPB[S01E01].m2ts.tempin_progress_
scenesraw_timestamps.txt"
[metadata @ 0000000008560400] Error setting option mode to value UsersAdministratorDesktoptmpPB[S01E01].m2ts.tempin_prog
ress_scenesraw_timestamps.txt.
[Parsed_metadata_1 @ 0000000008048780] Error applying options to the filter.
[AVFilterGraph @ 0000000008573c80] Error initializing filter 'metadata' with args 'print:file=C:\Users\Administrator\Des
ktop\tmp\PB[S01E01].m2ts.temp\in_progress_scenes\raw_timestamps.txt'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!
2021-06-11 11:23:07,393 WARNING - av1transcoder.command_line - ffmpeg command exited with non-zero return value indicati
ng failure. Failing input file: "E:\PB[S01E01].m2ts".
ffmpeg command exited with non-zero return value indicating failure. Failing input file: "E:\PB[S01E01].m2ts".
2021-06-11 11:23:07,394 INFO - av1transcoder.scene_cuts - Parsing the raw timestamps into Scenes.
Traceback (most recent call last):
File "c:\program files\python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\program files\python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Program Files\Python38\Scripts\av1transcoder.exe_main
.py", line 7, in
File "c:\program files\python38\lib\site-packages\av1transcoder\av1transcoder.py", line 38, in main
scenes = av1transcoder.scene_cuts.generate_scene_cuts(arguments, input_file)
File "c:\program files\python38\lib\site-packages\av1transcoder\scene_cuts.py", line 207, in generate_scene_cuts
scenes = parse_raw_timestamps_from_file(cli.raw_timestamps_file)
File "c:\program files\python38\lib\site-packages\av1transcoder\scene_cuts.py", line 229, in parse_raw_timestamps_from
_file
with raw_timestamps_path.open("r") as raw_timestamps:
File "c:\program files\python38\lib\pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "c:\program files\python38\lib\pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Administrator\Desktop\tmp\PB[S01E01].m2ts.temp\r
aw_timestamps.txt'

Now i get this error

Regards

@luziferius luziferius reopened this Jun 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