torre76 / hardsub

Python script that handles video hard subbing
3 stars 0 forks source link

AVI encoding support #6

Closed torre76 closed 11 years ago

torre76 commented 11 years ago

Also AVI should be supported by the system.

Assuming that the final file will be encoded in XviD the mencoder encoding command should be:

command = '{mencoder} -o "{output_file}" -nosound -noautosub -noskip -mc 0 -sub "{sub_file}" -subfont-text-scale "{subtitle_scale}" -ovc xvid -xvidencopts fixed_quant=2 "{input_file}"'.format(
        mencoder = which("mencoder")[0],
        output_file = "{}/{}.avi".format(output_dir, os.path.splitext(os.path.basename(file_name))[0]),
        sub_file = os.path.splitext(f)[0] + ".srt",
        subtitle_scale = scale,
        input_file = file_name
    )

while the audio extraction phase should be handled with mplayer / mencoder.

gquadro commented 11 years ago

See commit af719ac51859eb382b323017de249ca2bb47fc18

gquadro commented 11 years ago

The current implementation does not work correctly for AVI with multple audio streams: mencoder utilizes only the last one in the command.

Googling around, while I only found results some years old, it seems that multiple audio is not supported by mencoder and something else must be used.

ffmpeg is one possibility

gquadro commented 11 years ago

Implemented multiple audio mux; see commit 50082d6523d5e922d83aec9cee40b3edbf8ce455