Git Product home page Git Product logo

Comments (4)

hewr1993 avatar hewr1993 commented on August 13, 2024

A python script to generate .txt if you're interested

#!/usr/bin/env python3
import os
from utils import parse_nalu_lst

if __name__ == '__main__':
    import argparse
    parser = argparse.ArgumentParser()
    parser.add_argument(dest='input', type=str)
    parser.add_argument('--output', type=str)
    args = parser.parse_args()

    if args.output is None:
        args.output = os.path.join(os.path.dirname(args.input), '{}.txt'.format(os.path.splitext(args.input)[0]))

    fin = open(args.input, 'rb')
    indexes = []
    zero_count = 0

    i = 0
    while True:
        x = fin.read(1)
        if x == b'':
            break
        x = ord(x)
        if x == 0:
            zero_count += 1
        elif x == 3:
            pass
        elif x == 1:
            if zero_count == 2 or zero_count == 3:
                indexes.append(i - zero_count)
            zero_count = 0
        else:
            zero_count = 0
        i += 1
    indexes.append(i)

    with open(args.output, 'w') as fout:
        for i in range(len(indexes) - 1):
            print(indexes[i + 1] - indexes[i], file=fout)
    print('saved to "{}"'.format(args.output))

from wfs.js.

hewr1993 avatar hewr1993 commented on August 13, 2024

The problem is in .txt. The following command works now.

ffprobe yyyyyyy.264 -show_frames | grep pkt_size | awk '{ print substr($1,10,length($1)) }' > yyyyyyy.txt

It seems .264 must be in Baseline Profile. Maybe it's about codecs for fmp4. I'll come back later.

from wfs.js.

823639792 avatar 823639792 commented on August 13, 2024

txt文件是必须的吗?里边的数据是每一帧的长度吗?

from wfs.js.

ChihChengYang avatar ChihChengYang commented on August 13, 2024

from wfs.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.