ihmily / DouyinLiveRecorder

可循环值守和多人录制的直播录制软件,支持抖音、TikTok、快手、虎牙、斗鱼、B站、小红书、pandatv、sooplive、flextv、popkontv、twitcasting、winktv、百度、微博、酷狗、17Live、Twitch、Acfun、CHZZK等40+平台直播录制
MIT License
5.08k stars 624 forks source link

🐛[BUG] 主播切换清晰度录制的视频(不同分辨率)自动拼接 #727

Open zhixin601153 opened 1 month ago

zhixin601153 commented 1 month ago

⚠️ 确认是否已存在类似问题

🔧 运行方式

直接运行的exe文件

🐍 如果是使用源代码运行,请选择你的Python环境版本

None

💻 请选择你的系统环境

Windows 11

⚠️ 确认是否已经重试多次

🕹 复现步骤

1.https://live.douyin.com/28355754114 2.默认 ts录制完成后自动转为mp4格式 3.分段时间10800秒 4.原画录制

😯 问题描述

1.主播一般直播不超过3小时 2.今日开播(10月29日)忘记开蓝光(720p),半小时后提醒其打开蓝光(1080p),录制结束自动拼接自动转为一个mp4格式文件(2.45G) 3.文件上传直百度网盘,在线可播至第30分钟,之后的部分无法继续播放,但本地文件用VLC播放器是可以正常播放的,不同分辨率拼接处有卡顿 4.通过百度网盘分享的文件:10月29日.mp4 链接:https://pan.baidu.com/s/1vIQ7OvUDVDmz4Ath04NUjw?pwd=9999 提取码:9999 5.希望达成的目标是,主播切换不同分辨率后,当前录制停止,转码保存,然后继续录制切换后的

📜 错误信息

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Title: 🐛[BUG] Videos (different resolutions) recorded by the anchor when switching resolutions are automatically spliced ​​together

⚠️ Confirm whether similar problems already exist

🔧 How to run

exe file to run directly

🐍 If you are running from source code, please select your Python environment version

None

💻 Please select your system environment

Windows 11

⚠️ Confirm whether it has been retried multiple times

🕹 Steps to reproduce

1.https://live.douyin.com/28355754114

  1. By default, ts will be automatically converted to mp4 format after the recording is completed.
  2. Split time 10800 seconds
  3. Original painting recording

😯 Problem description

  1. Anchors generally live broadcast for no more than 3 hours.
  2. If you forget to turn on the Blu-ray (720p) when the broadcast starts today (October 29), you will be reminded to turn on the Blu-ray (1080p) half an hour later. After recording, it will be automatically spliced ​​and converted into an mp4 format file (2.45G).
  3. The file is uploaded directly to Baidu Netdisk and can be played online up to the 30th minute. The subsequent parts cannot be played. However, local files can be played normally with VLC player. There are lags at the splicing of different resolutions.
  4. Files shared through Baidu Netdisk: October 29.mp4 Link: https://pan.baidu.com/s/1vIQ7OvUDVDmz4Ath04NUjw?pwd=9999 Extraction code: 9999
  5. The goal we hope to achieve is that after the anchor switches to different resolutions, the current recording will stop transcoding and saving, and then continue recording after the switch.

📜 Error message

None

wwkk2580 commented 4 weeks ago

虎牙也有这个问题

Issues-translate-bot commented 4 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


Huya also has this problem

gyc0123 commented 3 weeks ago

main.py 文件里把这行删了,保存时候就自动转码了,如果经常需要这么转。 "-c:v", "copy",

def converts_mp4(address: str, is_original_delete: bool = True) -> None:

    _output = subprocess.check_output([
        "ffmpeg", "-i", address,
        "-c:v", "copy",
        "-c:a", "copy",
        "-f", "mp4", address.rsplit('.', maxsplit=1)[0] + ".mp4",
    ], stderr=subprocess.STDOUT, startupinfo=get_startup_info(os_type))
    if is_original_delete:
        time.sleep(1)
        if os.path.exists(address):
            os.remove(address)

偶尔的话ffmpeg -i input.mp4 output.mp4转换一下就好了,input.mp4换成要转的视频名,output.mp4是输出的视频名

我没试过,感觉应该行,要是你说的自动分段chatgpt说还得ffprobe循环检测视频流的分辨率

Issues-translate-bot commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


Delete this line in the main.py file and it will be automatically transcoded when saving. If you need to do this frequently. "-c:v", "copy",


def converts_mp4(address: str, is_original_delete: bool = True) -> None:
_output = subprocess.check_output([
    "ffmpeg", "-i", address,
    "-c:v", "copy",
    "-c:a", "copy",
    "-f", "mp4", address.rsplit('.', maxsplit=1)[0] + ".mp4",
], stderr=subprocess.STDOUT, startupinfo=get_startup_info(os_type))
if is_original_delete:
    time.sleep(1)
    if os.path.exists(address):
        os.remove(address)

Occasionally, just convert `ffmpeg -i input.mp4 output.mp4`. Input.mp4 is replaced by the name of the video to be converted, and output.mp4 is the name of the output video.  
wwkk2580 commented 2 weeks ago

main.py 文件里把这行删了,保存时候就自动转码了,如果经常需要这么转。 "-c:v", "copy",

def converts_mp4(address: str, is_original_delete: bool = True) -> None:

    _output = subprocess.check_output([
        "ffmpeg", "-i", address,
        "-c:v", "copy",
        "-c:a", "copy",
        "-f", "mp4", address.rsplit('.', maxsplit=1)[0] + ".mp4",
    ], stderr=subprocess.STDOUT, startupinfo=get_startup_info(os_type))
    if is_original_delete:
        time.sleep(1)
        if os.path.exists(address):
            os.remove(address)

偶尔的话ffmpeg -i input.mp4 output.mp4转换一下就好了,input.mp4换成要转的视频名,output.mp4是输出的视频名

我没试过,感觉应该行,要是你说的自动分段chatgpt说还得ffprobe循环检测视频流的分辨率

不转mp4,只录制ts的格式,也会有这个问题,主播修改分辨率后都是花屏

Issues-translate-bot commented 2 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


Delete this line in the main.py file and it will be automatically transcoded when saving. If you need to do this frequently. "-c:v", "copy",

def converts_mp4(address: str, is_original_delete: bool = True) -> None:

_output = subprocess.check_output([
"ffmpeg", "-i", address,
"-c:v", "copy",
"-c:a", "copy",
"-f", "mp4", address.rsplit('.', maxsplit=1)[0] + ".mp4",
], stderr=subprocess.STDOUT, startupinfo=get_startup_info(os_type))
if is_original_delete:
time.sleep(1)
if os.path.exists(address):
os.remove(address)

Occasionally, just convert ffmpeg -i input.mp4 output.mp4. Input.mp4 is the name of the video to be converted, and output.mp4 is the name of the output video.

I haven't tried it, but I think it should work. If you are talking about automatic segmentation, chatgpt says that you need to loop ffprobe to detect the resolution of the video stream.

If you do not convert to mp4, but only record in ts format, you will also have this problem. After the host changes the resolution, the screen will be blurry.

wwkk2580 commented 2 weeks ago

@ihmily 大佬这个问题有什么解决办法吗?

Issues-translate-bot commented 2 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


@ihmily Boss, do you have any solution to this problem?