Skip to content

Recorded video quality. after patch 6.2 #236

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

Open
akwldrk07 opened this issue Apr 8, 2025 · 6 comments
Open

Recorded video quality. after patch 6.2 #236

akwldrk07 opened this issue Apr 8, 2025 · 6 comments

Comments

@akwldrk07
Copy link

akwldrk07 commented Apr 8, 2025

Sorry, I wrote it through a translator.

Thank you for your program.

I previously made a fix through this link and got or4.flv.
#210

recording test after the patch, but it was recorded as uhd.flv.
Is there a separate option to get or4?
And can I request an additional option to change the -mode automatic time from 5 minutes to 1 minute? plz

ex)
This is the program I installed while checking for other bugs, and this is where I recorded or4.flv.
https://github.com/roju/tiktok-live-recorder

Thank you in advance for your wonderful update.

The picture tlr1.png below is your program,
Play : main.py -user UserName -mode automatic -output OutputFolder
Image

and tlr2.png is roju's program.
Play : ttlr.py -user UserName -mode auto -out_dir OutputFolder -ffmpeg -combine
Image

@Michele0303
Copy link
Owner

How come you want to get or4? it is lower quality right?

However in the future I will implement the option to select the quality of live

@akwldrk07
Copy link
Author

or4 doesn't mean the original?
In those two videos

  • uhd.flv was 720p
  • or4 was 1080p

I'll test it again and see the video format.

@gaeaearth
Copy link

How come you want to get or4? it is lower quality right?

However in the future I will implement the option to select the quality of live

I tested _uhd.flv and _or4.flv, both of which had the same codec and resolution, but _or4.flv had twice the bitrate of _uhd.flv. I think or4 is much higher.

@akwldrk07
Copy link
Author

akwldrk07 commented Apr 10, 2025

uhd":{"main":{"flv":"https://pull-f5-sg01.tiktokcdn.com/stage/stream-~~~~~~~~~_uhd.flv?
"sdk_params":"{"stream_suffix":"uhd","vbitrate":1000000,"resolution":"720x1280","gop":4,"v_rtbitrate":611870,"

origin":{"main":{"flv":"https://pull-f5-sg01.tiktokcdn.com/stage/stream-~~~~~~~~_or4.flv?
"sdk_params":"{"stream_suffix":"or4","vbitrate":1000000,"resolution":"720x1280","gop":4,"v_rtbitrate":1082890,
<<I modified it because the order of params was different.

or4 seems to be the original.

game live - hd.flv vs .flv
Image

chat live - hd.flv vs or4.flv
Image

@gaeaearth
Copy link

gaeaearth commented Apr 10, 2025

game live - hd.flv vs .flv Image

chat live - hd.flv vs or4.flv Image

As a workaround, you can replace lines 135 through 157 in '\core\tiktok_api.py' with the following to get or4.

From

    stream_url = data.get('data', {}).get('stream_url', {})

    # TODO: Implement m3u8 support
    # live_url_flv = stream_url.get('hls_pull_url', None)
    # if not live_url_flv:

    live_url_flv = (
            stream_url.get('flv_pull_url', {}).get('FULL_HD1') or
            stream_url.get('flv_pull_url', {}).get('HD1') or
            stream_url.get('flv_pull_url', {}).get('SD2') or
            stream_url.get('flv_pull_url', {}).get('SD1')
    )

    # if flv_pull_url is not available, use rtmp_pull_url
    if not live_url_flv:
        live_url_flv = stream_url.get('rtmp_pull_url', None)

    if not live_url_flv and data.get('status_code') == 4003110:
        raise UserLiveException(TikTokError.LIVE_RESTRICTION)

    logger.info(f"LIVE URL: {live_url_flv}\n")

    return live_url_flv`

To (this is from 'tiktokbot.py' in v5.8)

    live_url_flv = data.get(
        'data', {}).get('stream_url', {}).get('rtmp_pull_url', None)

    if live_url_flv is None and data.get('status_code') == 4003110:
        raise UserLiveException(TikTokError.LIVE_RESTRICTION)

    logger.info(f"LIVE URL: {live_url_flv}\n")

    return live_url_flv`

@RobinMeis
Copy link
Contributor

And can I request an additional option to change the -mode automatic time from 5 minutes to 1 minute? plz

I provided an additional option in pull request in #241

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

4 participants