Questions tagged [bitstream]

A Python library to manage binary data as bitstreams. Available from https://pypi.org

Bitstream three main features:

  • It is easy to use since the bitstream abstraction is simple.
  • It works seamlessly at the bit and byte level.
  • It supports Python, NumPy and user-defined types.
94 questions
2
votes
1 answer

Use Perl to Modify a Bitstream

How can I re-pack bits into a bitstream after modifying them in Perl? I'm currently using the following to unpack: my $bits = 5; my $code = ''; foreach my $i (reverse 0..$bits-1) { $code <<= 1; $code |= vec($data,$i,1); } For example, the…
xpsd300
  • 175
  • 2
  • 11
1
vote
1 answer

BitString with python

I am trying to use bitstring for python to interpret an incoming data packet and break it up into readable sections. the packet will consist of a header( Source (8bits), Destination (8bits), NS(3bits), NR(3bits), RSV(1bit), LST(1bit), OPcode(8bits),…
Friendlyghost89
  • 247
  • 8
  • 19
1
vote
0 answers

Creating "holes" in a binary H.264 bitstream

I am trying to simulate data loss in a video by selectively removing H.264 bitstream data. The data is simply a raw H.264 file, which is essentially a binary file. My plan is to delete 2 bytes for every 100 bytes so as to achieve a 2% loss.…
qontranami
  • 103
  • 1
  • 9
1
vote
0 answers

Is it possible to make VFR MP4 from a raw h264 bitstream using ffmpeg?

I have a raw h264 bitstream that I'd like to put into MP4 using ffmpeg but ffmpeg always produces it with a constant frame rate and I need it to be the variable frame rate. So lets say I have an MP4 with variable frame rate (output from…
Adam Szmyd
  • 2,765
  • 2
  • 24
  • 32
1
vote
1 answer

How to Remove a frame from an HEVC bitstream?

I have an HEVC encoded bitstream (.bin and equivalent .mp4 file). I want to remove some frames from the bitstream to see how a decoder (or media player) behaves when a particular frame is lost. enter image description here How I can remove a frame…
Satyam Rao
  • 13
  • 3
1
vote
1 answer

FFmpeg - How to encode raw screen buffers (frame arrays) into a bitstream?

I have thousands of frame arrays (NumPy) with shape (3, 225, 400), which were obtained from game screens. Each one of those frame buffers has a label (screen class and timestamp). I'd like to create a bitstream from those arrays, to be used for…
bbasaran
  • 364
  • 3
  • 15
1
vote
1 answer

Petalinux hangs during boot

I am trying to boot linux on a zedboard and monitor all memory accesses through Programmable Logic. I am first trying to boot linux with a start address  0x40000000. I am following this…
1
vote
1 answer

How to save a string of 1's and 0's as binary to a binary file in Python

I am currently trying to complete a project for school that involves reading an audio 'wav' file, using a golomb encoder to encode the samples, writing the result to a binary file, reading that binary file on another script and decoding it using the…
1
vote
1 answer

Casting (convert) structure to array of bits: bit-stream type error

In systemverilog LRM, there is a sample code to explain casting. When I try this code, there is an error. typedef struct { bit isfloat; union { int i; shortreal f; } n; // anonymous type } tagged_st; // named structure typedef bit…
Yunsung Mo
  • 89
  • 1
  • 6
1
vote
0 answers

Pattern recognition in a bitstream

Assume a long bitstream of bits. I want to discover some patterns in this bitstream. What I know is that this bitstream is not a random bitstream and contains some repetitive pattern. As an example, assume that the bitstream is as…
Saeed Hassanvand
  • 931
  • 1
  • 14
  • 31
1
vote
0 answers

FFmpeg bitstream filter that can take two inputs

I tried looking into the FFmpeg documentation, but couldn't find any bitstream filter that could take two inputs. Is this not possible by design, or has such a use-case just not come up until now?
nsp
  • 87
  • 8
1
vote
1 answer

Are some 8x8 blocks skipped when encoding a JPEG?

I am trying to split a compressed JPEG bitstream into the 8x8 blocks of the original image. However, I am routinely finding fewer than I know there to be based on the size of the image. I have narrowed this down to the first row of the image, where…
Mike H
  • 21
  • 3
1
vote
0 answers

Are DC coefficients included in every block of a compressed JPEG without exception?

I am reading a compressed JPEG bitstream bitwise to locate the EOB markers. After each EOB, I would expect to find a Huffman code representing the DC coefficient bit-size. In the vast majority of cases this I have found this to be true, but…
Mike H
  • 21
  • 3
1
vote
1 answer

Bitstream Library in Scala

I need to compress/decompress some Data with a old, in house developed Algorithm. There i have a lot of operations like: if the next bit is 0 take the following 6 Bits and interpret them as an Int if the next bits are 10 take the following 9 Bits…
Fabian
  • 1,224
  • 1
  • 11
  • 26
1
vote
1 answer

Representing streams of bits in a byte stream

I'm experimenting with some ideas in which algorithms have to work on bits as their smallest unit of information. This is a modular application where the user may rearrange parts of the "pipeline" like a unix shell pipeline. These algorithms do…
Juliano
  • 39,173
  • 13
  • 67
  • 73