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

Documentation #25

Open
GenericJam opened this issue Nov 14, 2020 · 1 comment
Open

Documentation #25

GenericJam opened this issue Nov 14, 2020 · 1 comment
Labels

Comments

@GenericJam
Copy link

GenericJam commented Nov 14, 2020

Greetings! Thank you for putting together this great library! Would it be possible to improve the Readme and/or document the API a little better? I'm a bit of a newbie to ffmpeg and the ffmpeg list of options is vast and pretty difficult for newbies to get into.

Would it be possible to at minimum document all of the available functions? I did this myself using iex:

Advanced    Audio       Devices     Helpers     Main        Subtitle
Video
iex(2)> FFmpex.Options.Advanced.option_
option_abort_on/0                  option_abort_on/1
option_accurate_seek/0             option_accurate_seek/1
option_async/0                     option_async/1
option_benchmark/0                 option_benchmark/1
option_benchmark_all/0             option_benchmark_all/1
option_bsf/0                       option_bsf/1
option_copy_unknown/0              option_copy_unknown/1
option_copytb/0                    option_copytb/1
option_copyts/0                    option_copyts/1
option_discard/0                   option_discard/1
option_dts_delta_threshold/0       option_dts_delta_threshold/1
option_dump/0                      option_dump/1
option_filter_complex/0            option_filter_complex/1
option_filter_complex_script/0     option_filter_complex_script/1
option_filter_complex_threads/0    option_filter_complex_threads/1
option_frame_drop_threshold/0      option_frame_drop_threshold/1
option_hex/0                       option_hex/1
option_ignore_unknown/0            option_ignore_unknown/1
option_lavfi/0                     option_lavfi/1
option_loop/0                      option_loop/1
option_map/0                       option_map/1
option_map_channel/0               option_map_channel/1
option_map_chapters/0              option_map_chapters/1
option_map_metadata/0              option_map_metadata/1
option_max_muxing_queue_size/0     option_max_muxing_queue_size/1
option_muxdelay/0                  option_muxdelay/1
option_muxpreload/0                option_muxpreload/1
option_override_ffserver/0         option_override_ffserver/1
option_re/0                        option_re/1
option_sdp_file/0                  option_sdp_file/1
option_seek_timestamp/0            option_seek_timestamp/1
option_shortest/0                  option_shortest/1
option_start_at_zero/0             option_start_at_zero/1
option_streamid/0                  option_streamid/1
option_tag/0                       option_tag/1
option_thread_queue_size/0         option_thread_queue_size/1
option_timecode/0                  option_timecode/1
option_timelimit/0                 option_timelimit/1
option_vsync/0                     option_vsync/1
option_xerror/0                    option_xerror/1

iex(2)> FFmpex.Options.Audio.option_
option_absf/0                option_absf/1
option_ac/0                  option_ac/1
option_acodec/0              option_acodec/1
option_af/0                  option_af/1
option_aframes/0             option_aframes/1
option_an/0                  option_an/1
option_aq/0                  option_aq/1
option_ar/0                  option_ar/1
option_atag/0                option_atag/1
option_guess_layout_max/0    option_guess_layout_max/1
option_sample_fmt/0          option_sample_fmt/1

iex(2)> FFmpex.Options.Devices.Libavdevice.option_
option_draw_mouse/0    option_draw_mouse/1    option_framerate/0
option_framerate/1     option_video_size/0    option_video_size/1

iex(2)> FFmpex.Options.Main.option_
option_attach/0             option_attach/1
option_c/0                  option_c/1
option_codec/0              option_codec/1
option_debug_ts/0           option_debug_ts/1
option_dframes/0            option_dframes/1
option_disposition/0        option_disposition/1
option_dump_attachment/0    option_dump_attachment/1
option_f/0                  option_f/1
option_filter/0             option_filter/1
option_filter_script/0      option_filter_script/1
option_filter_threads/0     option_filter_threads/1
option_frames/0             option_frames/1
option_fs/0                 option_fs/1
option_i/0                  option_i/1
option_itsoffset/0          option_itsoffset/1
option_metadata/0           option_metadata/1
option_n/0                  option_n/1
option_noautorotate/0       option_noautorotate/1
option_pre/0                option_pre/1
option_program/0            option_program/1
option_progress/0           option_progress/1
option_q/0                  option_q/1
option_qscale/0             option_qscale/1
option_ss/0                 option_ss/1
option_sseof/0              option_sseof/1
option_stats/0              option_stats/1
option_stdin/0              option_stdin/1
option_stream_loop/0        option_stream_loop/1
option_t/0                  option_t/1
option_target/0             option_target/1
option_timestamp/0          option_timestamp/1
option_to/0                 option_to/1
option_y/0                  option_y/1

iex(2)> FFmpex.Options.Subtitle.option_
option_canvas_size/0         option_canvas_size/1
option_fix_sub_duration/0    option_fix_sub_duration/1
option_sbsf/0                option_sbsf/1
option_scodec/0              option_scodec/1
option_sn/0                  option_sn/1

And what you can use to build and execute the query:

add_file_option/2
add_global_option/2       add_input_file/2          add_output_file/2
add_stream_option/2       add_stream_specifier/2    execute/1
new_command/0             prepare/1

Would it be possible to publish this list with what you would typically put in as the arg?

Also, what if my option isn't on the list? Is there a generic function where I can drop whatever I want in at my own risk?

It would also be really helpful to show how to transform some common existing scripts into this format.

Thank you!

@talklittle
Copy link
Owner

Yes, documentation could be improved.

Also, what if my option isn't on the list? Is there a generic function where I can drop whatever I want in at my own risk?

See the tests for manual FFmpex.Option structs:

test "manually specified option struct" do
manual_option = %FFmpex.Option{name: "-strict", argument: "very"}
command =
FFmpex.new_command
|> add_global_option(option_y())
|> add_global_option(manual_option)
|> add_input_file(@fixture)
|> add_output_file(@output_path)
assert :ok = execute(command)
end
test "error if invalid manual option name" do
manual_option = %FFmpex.Option{name: "-thisisabadoptionitshouldfail", argument: "lolololol"}
command =
FFmpex.new_command
|> add_global_option(manual_option)
|> add_input_file(@fixture)
|> add_output_file(@output_path)
assert {:error, {_, 1}} = execute(command)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants