我有一个重新编码的视频,我正在尝试通过短信发送给三星。从iPhone发送到三星时,质量太模糊,无法看到

i have a reencoded video i am trying to send to a samsung over text message. The quality is too blurry to see when sent from an iphone to a samsung

提问人:test22 提问时间:10/25/2023 最后编辑:snakecharmerbtest22 更新时间:10/27/2023 访问量:17

问:

from converter import Converter
import sys

sys.path.append("ffprobe")
sys.path.append("ffmpeg")

ffmpegPath = "/Users/test/Sites/Coding/ffmpeg"
ffprobePath = "/Users/test/Sites/Coding/ffprobe"
conv = Converter(ffmpegPath, ffprobePath)

input_file = "Final Judgment tutorial forclosures.mov"
output_file = "Final Judgment tutorial forclosures.mp4"

# Probe the input video file to get its information
info = conv.probe(input_file)

# Define the output options for regular conversion
options = {
    "format": "mp4",
    "audio": {
        "codec": "aac",
        "samplerate": 44100,
        "channels": 2,
    },
    "video": {
        "codec": "h264",  # Change to h264 or hevc
        "width": 640,  # Adjust to Samsung device resolution
        "height": 360,  # Adjust to Samsung device resolution
        "fps": 30,  # Adjust to a common frame rate
        "video_stream": "yuv420p",
        "colorspace": "bt709",
        "color_primaries": "bt709",
    }
}

# Perform the regular conversion
convert = conv.convert(input_file, output_file, options)

# Print progress
for timecode in convert:
    print(f'\rConverting ({timecode:.2f}) ...')

# Define the options for re-encoding for text message
imessage_output_file = "Final Judgment tutorial forclosures_imessage.mp4"
imessage_options = {
    "format": "mp4",
    "audio": options["audio"],  # Inherit audio settings from regular conversion
    "video": options["video"],  # Inherit video settings from regular conversion
    "vf": "scale=iw*2:ih*2, scale=iw/2:ih/2, unsharp=5:5:1:5:5:1"
}

# Perform the re-encoding for text message
imessage_output = conv.convert(output_file, imessage_output_file, imessage_options)

# Print progress for the re-encoding
for timecode in imessage_output:
    print(f'\rRe-encoding ({timecode:.2f}) ...')

我有一个重新编码的视频,我正在尝试通过短信发送给三星。从iPhone发送到三星时,质量太模糊而无法看到,但是在将iPhone发送到iPhone时(在两者的消息中)时,质量都很清楚,请帮助编码新手

python 视频 编码 文件转换

评论

0赞 test22 10/25/2023
我是编码新手。任何帮助都将受到极大的赞赏。我花了无数个小时试图弄清楚这一点。

答: 暂无答案