### Clone Repository and Setup Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md This snippet shows how to clone the project repository and run the setup script. It requires Git and assumes the user has Docker installed, as the setup script likely prepares a Docker environment for subsequent commands. ```bash git clone https://github.com/leandromoreira/digital_video_introduction.git cd digital_video_introduction ./setup.sh ``` -------------------------------- ### Setup Digital Video Project Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Clones the digital video introduction repository and runs the setup script. This is a prerequisite for performing hands-on exercises. ```Bash git clone https://github.com/leandromoreira/digital_video_introduction.git cd digital_video_introduction ./setup.sh ``` -------------------------------- ### Start Jupyter Server Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md This command initiates a Jupyter server, which is used for running interactive examples within the documentation. Users are instructed to copy the provided URL to access the server in their browser. ```bash ./s/start_jupyter.sh ``` -------------------------------- ### FFmpeg Usage Guide Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A link to a guide on how to use FFmpeg, potentially covering common use cases and avoiding pitfalls in video processing workflows. ```Shell https://videoblerg.wordpress.com/2017/11/10/ffmpeg-and-how-to-use-it-wrong/ ``` -------------------------------- ### Start Jupyter Notebook with Docker Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md This command initiates a Jupyter Notebook environment using Docker. Ensure Docker is installed before running this script. The script will guide you through the setup process via the console. ```bash ./s/start_jupyter.sh ``` -------------------------------- ### H.264 Encoding Guide Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A link to a guide on H.264 encoding, likely covering best practices and technical details for using the H.264/AVC video compression standard. ```Shell http://www.adobe.com/devnet/adobe-media-server/articles/h264_encoding.html ``` -------------------------------- ### VP9 Partitions Analysis Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Provides an example of analyzing VP9 video codec partitions, referencing a practical demonstration within a transcoding context. This analysis is typically performed using specialized tools like the Intel Video Pro Analyzer. ```URL /encoding_pratical_examples.md#transcoding ``` -------------------------------- ### Quantization Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md This 'Do It Yourself' task demonstrates the effect of quantization, a lossy compression technique used in video codecs. Users will likely experiment with different quantization parameters to observe the trade-off between quality and size. ```bash ./s/ffmpeg -i input.mp4 -qp 28 output_quantized.mp4 ``` -------------------------------- ### Examine Partitions Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md This 'Do It Yourself' section guides users to examine image partitions, a fundamental step in video codecs like H.264 and H.265. It helps understand how images are divided for more efficient compression. ```bash ./s/ffmpeg -i input.mp4 -vf "ldots=ldots" output_partitions.png ``` -------------------------------- ### x264 Settings Guide Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This guide from Wikibooks provides detailed information on x264 settings, a popular open-source encoder for H.264. It helps users optimize encoding parameters for different needs. ```Shell https://en.wikibooks.org/wiki/MeGUI/x264_Settings ``` -------------------------------- ### FFmpeg Wiki and Development Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md The FFmpeg wiki provides community-driven information, tutorials, and development resources. It's a great place to find specific guides and troubleshooting tips for using FFmpeg. ```Shell https://trac.ffmpeg.org/wiki/ ``` -------------------------------- ### Video with Single I-Frame Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md This 'Do It Yourself' example involves creating or analyzing a video that contains only a single I-frame (keyframe). This is useful for understanding intra-frame compression and its implications. ```bash ./s/ffmpeg -i input.mp4 -g 1 output_single_iframe.mp4 ``` -------------------------------- ### FFmpeg Oscilloscope Filter Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md This entry refers to an example demonstrating the use of the FFmpeg oscilloscope filter. The specific command or code is not provided here, but it implies interaction with FFmpeg within a Docker container. ```bash ./s/ffmpeg -i input.mp4 -vf "ldots=..." output.mp4 ``` -------------------------------- ### Generate 2-Second Example Video with FFmpeg Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/encoding_pratical_examples.md Extracts a 2-second segment from a source video file, starting at a specific timestamp. This is useful for creating smaller test files or previews. ```shell ./s/ffmpeg -y -i /files/v/bunny_1080p_30fps.mp4 -ss 00:01:24 -t 00:00:02 /files/v/smallest_bunny_1080p_30fps.mp4 ``` -------------------------------- ### Variable-Length Coding (VLC) Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-it.md This example demonstrates variable-length coding for symbols 'a', 'e', 'r', and 't' with given probabilities. It shows how to assign binary codes and compress a sequence of symbols, illustrating the concept of prefix codes. ```Python # Symbol probabilities probabilities = {'a': 0.3, 'e': 0.3, 'r': 0.2, 't': 0.2} # Example binary codes (derived from Huffman or similar) # Note: In a real implementation, these would be generated algorithmically. vlc_codes = { 'a': '0', 'e': '10', 'r': '110', 't': '1110' } # Input sequence input_sequence = "eat" # Encode the sequence encoded_bits = "" for symbol in input_sequence: encoded_bits += vlc_codes[symbol] print(f"Input sequence: {input_sequence}") print(f"Encoded bits: {encoded_bits}") print(f"Original bits (assuming 8 bits/symbol): {len(input_sequence) * 8}") print(f"Compressed bits: {len(encoded_bits)}") # Example of decoding (requires the same code table) def decode_vlc(encoded_data, codes): reverse_codes = {v: k for k, v in codes.items()} decoded_sequence = "" current_code = "" for bit in encoded_data: current_code += bit if current_code in reverse_codes: decoded_sequence += reverse_codes[current_code] current_code = "" return decoded_sequence decoded_sequence = decode_vlc(encoded_bits, vlc_codes) print(f"Decoded sequence: {decoded_sequence}") ``` -------------------------------- ### Android Media Formats Guide Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Android developer documentation on media formats, covering supported audio and video codecs, containers, and playback capabilities on Android devices. ```Shell https://developer.android.com/guide/topics/media/media-formats.html ``` -------------------------------- ### Transcode Video to VP9 with FFmpeg Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/encoding_pratical_examples.md Transcodes a video file to the VP9 codec with a specified bitrate, using the libvpx-vp9 encoder and libvorbis for audio. This example demonstrates efficient video compression. ```shell ./s/ffmpeg -i /files/v/smallest_bunny_1080p_30fps.mp4 -c:v libvpx-vp9 -b:v 600K -c:a libvorbis /files/v/smallest_bunny_1080p_30fps_vp9.webm ``` -------------------------------- ### FFmpeg Rate Control Guide Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A guide to rate control in FFmpeg, explaining different methods like Constant Rate Factor (CRF) and Variable Bitrate (VBR) for managing video quality and file size. ```Shell http://slhck.info/video/2017/03/01/rate-control.html ``` ```Shell http://slhck.info/video/2017/02/24/vbr-settings.html ``` ```Shell http://slhck.info/video/2017/02/24/crf-guide.html ``` -------------------------------- ### H.264 Encoding Guide Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This article from Adobe discusses H.264 encoding, providing insights into the process and best practices for achieving efficient video compression. ```Shell http://www.adobe.com/devnet/adobe-media-server/articles/h264_encoding.html ``` -------------------------------- ### Uniform Quantization Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md Illustrates the process of uniform quantization by dividing a coefficient block by a scalar value (e.g., 10) and rounding. It also shows the reverse process (de-quantization) by multiplying by the same scalar. ```Python import numpy as np # Assume coefficient_block is the result from DCT # For demonstration, let's create a sample block coefficient_block = np.random.randint(-100, 100, size=(8, 8)) quantization_step = 10 # Quantization quantized_block = np.round(coefficient_block / quantization_step) print("Original Coefficient Block:\n", coefficient_block) print("\nQuantized Block:\n", quantized_block) # De-quantization (Re-quantization) reconstructed_coefficients = quantized_block * quantization_step print("\nDe-quantized Coefficients:\n", reconstructed_coefficients) ``` -------------------------------- ### FFmpeg Command-Line Tool Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md FFmpeg is a powerful open-source tool for handling multimedia data. It can be used for recording, converting, and streaming audio and video. The provided links offer comprehensive documentation and usage examples. ```Shell https://ffmpeg.org/ ``` ```Shell https://ffmpeg.org/ffmpeg-all.html ``` ```Shell https://ffmpeg.org/ffprobe.html ``` -------------------------------- ### Variable-Length Coding (VLC) Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Demonstrates Variable-Length Coding (VLC) for symbol compression. Symbols with higher probabilities are assigned shorter binary codes, and vice versa. The example shows encoding the stream 'eat' using predefined codes, resulting in a compressed bitstream. ```text Symbol Table: a: probability 0.3, binary code 0 e: probability 0.3, binary code 10 r: probability 0.2, binary code 110 t: probability 0.2, binary code 1110 Stream 'eat' encoded: [10][0][1110] -> 1001110 (7 bits) ``` -------------------------------- ### Start Jupyter with Docker Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-it.md This command initiates a Jupyter Notebook environment using Docker. It assumes a script named 'start_jupyter.sh' is available in the './s/' directory. Users should follow the terminal instructions after execution. ```bash ./s/start_jupyter.sh ``` -------------------------------- ### Quantization Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Illustrates a simple uniform quantization process where a block of coefficients is divided by a single value (e.g., 10) and then rounded. The reverse process, re-quantization, involves multiplying by the same value. ```text Quantize block: divide by 10, round. Re-quantize block: multiply by 10. ``` -------------------------------- ### Variable Length Coding (VLC) Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md Demonstrates Variable Length Coding (VLC) using a simple probability table for symbols 'a', 'e', 'r', 't'. It shows how assigning shorter binary codes to more frequent symbols can achieve compression. ```Python # Example symbol probabilities probabilities = {'a': 0.3, 'e': 0.3, 'r': 0.2, 't': 0.2} # Example VLC codes (manually assigned for demonstration) # In practice, Huffman coding or similar algorithms generate these. vlc_codes = { 'a': '0', 'e': '10', 'r': '110', 't': '1110' } # Input stream to compress input_stream = "eat" # Encode the stream encoded_stream = "".join([vlc_codes[char] for char in input_stream]) print(f"Input stream: {input_stream}") print(f"VLC Codes: {vlc_codes}") print(f"Encoded stream (bits): {encoded_stream}") # Calculate original and compressed size (assuming 8 bits per char originally) original_size_bits = len(input_stream) * 8 compressed_size_bits = len(encoded_stream) print(f"Original size: {original_size_bits} bits") print(f"Compressed size: {compressed_size_bits} bits") print(f"Compression ratio: {original_size_bits / compressed_size_bits:.2f}x") # Decoding requires the same VLC table def decode_stream(encoded_data, codes): reverse_codes = {v: k for k, v in codes.items()} decoded_text = "" current_code = "" for bit in encoded_data: current_code += bit if current_code in reverse_codes: decoded_text += reverse_codes[current_code] current_code = "" return decoded_text decoded_text = decode_stream(encoded_stream, vlc_codes) print(f"Decoded stream: {decoded_text}") ``` -------------------------------- ### DCT Transformation Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md Demonstrates the transformation of a pixel block into frequency coefficients using DCT. It shows the resulting coefficient block and its visual representation, emphasizing the concentration of energy in low-frequency components. ```Python import numpy as np def dct2(a): return np.fft.fft2(a) # Example pixel block (8x8) pixel_block = np.random.rand(8, 8) * 255 # Apply DCT coefficient_block = dct2(pixel_block) # Displaying the coefficient block (for demonstration, actual visualization would be different) print("DCT Coefficient Block:\n", coefficient_block) # To visualize, one might take the magnitude and log scale import matplotlib.pyplot as plt plt.figure() plt.imshow(np.log(np.abs(coefficient_block) + 1e-9), cmap='gray') plt.title('DCT Coefficients (Log Scale)') plt.colorbar() plt.show() # Example of zeroing out high-frequency coefficients (e.g., bottom-right) quantized_block = coefficient_block.copy() quantized_block[4:, 4:] = 0 # Zero out a portion # Inverse DCT (for demonstration of reversibility) from scipy.fftpack import idctn reconstructed_block = idctn(quantized_block, shape=pixel_block.shape) plt.figure() plt.subplot(1, 2, 1) plt.imshow(pixel_block, cmap='gray') plt.title('Original Pixel Block') plt.subplot(1, 2, 2) plt.imshow(reconstructed_block, cmap='gray') plt.title('Reconstructed Block') plt.show() ``` -------------------------------- ### FFmpeg Macroblocks and Motion Vectors Debugging Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A guide on debugging macroblocks and motion vectors in FFmpeg, providing insights into how to analyze video frames and motion estimation for troubleshooting encoding issues. ```Shell https://trac.ffmpeg.org/wiki/Debug/MacroblocksAndMotionVectors ``` -------------------------------- ### Inspect Video Properties with FFmpeg/mediainfo Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md This snippet provides a link to a practical guide on using FFmpeg or mediainfo to inspect various video properties discussed in the document, such as resolution, frame rate, and encoding type (CBR/VBR). It's a hands-on approach to understanding video characteristics. ```text You can [check most of the explained properties with ffmpeg or mediainfo.](https://github.com/leandromoreira/introduction_video_technology/blob/master/encoding_pratical_examples.md#inspect-stream) ``` -------------------------------- ### Generate H.264 Bitstream with ffmpeg Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md This command uses ffmpeg to convert a PNG image into a raw H.264 bitstream. The output stream will have a yuv420 color space and a single frame of 64x64 resolution. This is a practical example of creating a basic video bitstream. ```bash ./s/ffmpeg -i /files/i/minimal.png -pix_fmt yuv420p /files/v/minimal_yuv420.h264 ``` -------------------------------- ### Streaming Onboarding Material Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Onboarding material for streaming technologies, likely covering introductory concepts and best practices for setting up and managing video streaming services. ```Shell https://github.com/Eyevinn/streaming-onboarding ``` -------------------------------- ### JPEG Quantization Matrix Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-it.md This snippet provides an example of a quantization matrix used in JPEG compression. It highlights how different coefficients are quantized differently, with more emphasis on lower-left coefficients and less on upper-right ones. ```C++ #include #include // Example quantization matrix (simplified) const std::vector> quantization_matrix = { {16, 11, 10, 16, 24, 40, 51, 61}, {12, 12, 14, 19, 26, 29, 35, 41}, {14, 13, 16, 24, 30, 34, 42, 47}, {14, 17, 21, 26, 31, 37, 44, 51}, {18, 22, 27, 32, 37, 43, 50, 56}, {20, 25, 30, 36, 42, 48, 55, 62}, {24, 29, 34, 40, 47, 54, 61, 68}, {28, 33, 39, 45, 52, 59, 66, 75} }; int main() { // In a real scenario, this matrix would be used to divide DCT coefficients. // For example: // quantized_coefficient = round(original_coefficient / quantization_matrix[row][col]); std::cout << "Example quantization matrix loaded." << std::endl; return 0; } ``` -------------------------------- ### Online Courses and Tutorials Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This section provides links to various online courses and tutorials covering digital video, compression, and related technologies. ```Shell https://www.coursera.org/learn/digital/ ``` ```Shell https://people.xiph.org/~tterribe/pubs/lca2012/auckland/intro_to_video1.pdf ``` ```Shell https://xiph.org/video/vid1.shtml ``` ```Shell https://xiph.org/video/vid2.shtml ``` -------------------------------- ### libvpx VP9 Source Code Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Link to the libvpx repository on GitHub, specifically the VP9 codec implementation, allowing developers to access and study the source code. ```Shell https://github.com/webmproject/libvpx/tree/master/vp9 ``` -------------------------------- ### H.264 Encoding Explained Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This resource likely explains the process of H.264 encoding, potentially covering parameters and best practices. ```Shell http://www.lighterra.com/papers/videoencodingh264/ ``` -------------------------------- ### WebM Project Resources Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This link points to the Google Code repository for libvpx, the open-source software implementation of the VP8 and VP9 video codecs. ```Shell https://github.com/webmproject/libvpx/tree/master/vp9 ``` -------------------------------- ### Video Sequences for Testing Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This link provides access to video datasets and organizations involved in video quality testing and benchmarking. ```Shell http://bbb3d.renderfarming.net/download.html ``` ```Shell https://www.its.bldrdoc.gov/vqeg/video-datasets-and-organizations.aspx ``` -------------------------------- ### FFmpeg Wiki Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md The official FFmpeg wiki, containing a wealth of information, tutorials, and community contributions related to FFmpeg usage and development. ```Shell https://trac.ffmpeg.org/wiki/ ``` -------------------------------- ### How Video Works Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A resource explaining the fundamental principles of how video works, from capture to display, covering concepts like frame rates, resolution, and encoding. ```Shell https://howvideo.works/ ``` -------------------------------- ### 使用 FFmpeg 生成包含帧间预测(运动向量)的视频 Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md 演示如何使用 FFmpeg 工具生成包含帧间预测(运动向量)信息的调试视频,以便直观地分析视频压缩过程中的运动估计。 ```bash ffmpeg -i input.mp4 -vf "idet,schedts,showinfo,drawtext=text='Frame %d':x=10:y=10:fontsize=24:fontcolor=white" -f null - ``` -------------------------------- ### H.264 Resolution Calculation Fields Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Shows example parameters from an SPS NAL unit used to calculate video resolution: `pic_width_in_mbs_minus_1` and `pic_height_in_map_units_minus_1`. These values are encoded using Exp-Golomb coding. ```text pic_width_in_mbs_minus_1 ``` ```text pic_height_in_map_units_minus_1 ``` -------------------------------- ### Check Video Properties with mediainfo Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md This 'Do It Yourself' section involves checking video properties using the 'mediainfo' tool, likely executed within a Docker container as indicated by the './s/mediainfo' prefix. This helps users understand video file characteristics. ```bash ./s/mediainfo video.mp4 ``` -------------------------------- ### FOSDEM AV1 Presentation Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This link refers to a presentation about AV1 at FOSDEM, likely covering its development and features. ```Shell https://fosdem.org/2017/schedule/event/om_av1/ ``` -------------------------------- ### MP3 and AAC Explained Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This resource provides an explanation of MP3 and AAC audio compression formats, covering their principles and how they work. ```Shell https://prezi.com/8m7thtvl4ywr/mp3-and-aac-explained/ ``` -------------------------------- ### 使用 FFmpeg 生成包含宏块及帧内预测的视频 Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md 展示如何利用 FFmpeg 工具生成包含宏块和帧内预测信息的视频,这有助于理解帧内预测的原理以及宏块的颜色编码含义。 ```bash ffmpeg -i input.mp4 -vf "idet,schedts,showinfo,drawtext=text='Frame %d':x=10:y=10:fontsize=24:fontcolor=white" -f null - ``` -------------------------------- ### H.264 IDR Slice NAL Unit Type Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-it.md An IDR (Instantaneous Decoding Refresh) slice NAL unit signifies the start of an intra-coded picture. Its NAL unit type is typically represented as `00101` (decimal 5). ```text Example IDR Slice NAL unit first byte (after sync marker): Binary representation of first 6 bytes: 01100101 10001000 10000100 00000000 00100001 11111111 NAL Unit Type (last 5 bits of first byte): 00101 (Decimal 5), indicating IDR Slice. ``` -------------------------------- ### Introduction to Video Compression Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This presentation offers an introduction to the fundamental concepts of video compression. ```Shell http://www.slideshare.net/vcodex/introduction-to-video-compression-13394338 ``` -------------------------------- ### Get RGB Pixel Intensity Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/image_as_3d_array.ipynb Retrieves the RGB intensity values of a specific pixel from a processed image region. It then prints the Red, Green, and Blue intensity, scaled to a 0-255 range. ```python latest_pixel = zoomed_eye_split[3, 3] print("R intensity at x=3, y=3 is",round(256 * latest_pixel[0])) print("G intensity at x=3, y=3 is",round(256 * latest_pixel[1])) print("B intensity at x=3, y=3 is",round(256 * latest_pixel[2])) ``` -------------------------------- ### VP9 Video Codec Overview Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md An overview of the VP9 video codec, discussing its features and how it works, providing insights into this efficient video compression standard. ```Shell https://blogs.gnome.org/rbultje/2016/12/13/overview-of-the-vp9-video-codec/ ``` -------------------------------- ### H.264 SPS NAL Unit Profile IDC Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-it.md The second byte of an H.264 SPS NAL unit specifies the `profile_idc`, which indicates the encoding profile used. For example, a `profile_idc` value might correspond to profiles like 'Constrained High'. ```text Example SPS NAL unit second byte: - Binary: 01100100 - Hexadecimal: 0x64 - Decimal: 100 - Corresponds to 'Constrained High' profile. ``` -------------------------------- ### Audio Compression Explained Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This presentation explains the principles behind audio compression, likely covering formats like MP3 and AAC. ```Shell http://www.slideshare.net/MadhawaKasun/audio-compression-23398426 ``` -------------------------------- ### Generate Debug Video with ffmpeg Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-it.md This example demonstrates how to generate a video that visualizes macro-blocks and their predictions using ffmpeg. It's useful for understanding intra-frame prediction techniques in detail. Refer to the ffmpeg documentation for a deeper understanding of macro-block types. ```bash ffmpeg -i input.mp4 -vf "codecview=mv=0:inter=0" -c:a copy output.mp4 ``` -------------------------------- ### Exponential-Golomb Decoding Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md Exponential-Golomb coding is used to decode variable-length values in H.264, such as 'ue(v)', 'me(v)', 'se(v)', and 'te(v)'. This method is efficient for encoding values with many defaults. ```text ue(v) ``` ```text me(v) ``` ```text se(v) ``` ```text te(v) ``` -------------------------------- ### H.264 SPS NAL Unit Profile IDC Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md The second bit of the first byte in an SPS NAL unit represents the profile_idc. In the example `01100100` (binary), the profile_idc is `01100` (binary), which corresponds to a high profile. ```binary 01100100 ``` -------------------------------- ### Doom9 Forum Discussions Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Links to discussions on the Doom9 forum, a popular community for video encoding enthusiasts, covering topics related to codecs and video processing. ```Shell https://forum.doom9.org/showthread.php?t=167081 ``` ```Shell https://forum.doom9.org/showthread.php?t=168947 ``` -------------------------------- ### FFmpeg and FFprobe Usage Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Links to the official FFmpeg and FFprobe documentation, essential command-line tools for handling multimedia data. These tools are widely used for video and audio conversion, streaming, and analysis. ```Shell https://ffmpeg.org/ ``` ```Shell https://ffmpeg.org/ffmpeg-all.html ``` ```Shell https://ffmpeg.org/ffprobe.html ``` -------------------------------- ### MP3 and AAC Explained Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md An explanation of MP3 and AAC audio compression formats, covering their principles, features, and differences. ```Shell https://prezi.com/8m7thtvl4ywr/mp3-and-aac-explained/ ``` -------------------------------- ### H.264 IDR Slice NAL Unit Header Example Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Provides the first 6 bytes of an IDR Slice NAL unit, illustrating the binary values that define its type and header information. The `nal_unit_type` for an IDR slice is 5. ```binary 01100101 10001000 10000100 00000000 00100001 11111111 ``` -------------------------------- ### Video Encoding Course Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This link suggests an online course focused on video encoding, likely covering various codecs and techniques. ```Shell http://slhck.info/ffmpeg-encoding-course ``` -------------------------------- ### Parse H.264 Bitstream with MediaInfo Source Code Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md This snippet provides a link to the C++ source code for parsing H.264 (AVC) bitstreams, as used by the MediaInfo tool. It's a practical example for understanding how bitstream data is processed programmatically. ```cpp https://github.com/MediaArea/MediaInfoLib/blob/master/Source/MediaInfo/Video/File_Avc.cpp ``` -------------------------------- ### VP9 Video Codec Overview Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This blog post offers an overview of the VP9 video codec, discussing its features and advantages as an open and royalty-free compression standard. ```Shell https://blogs.gnome.org/rbultje/2016/12/13/overview-of-the-vp9-video-codec/ ``` -------------------------------- ### H.264 NAL Unit Type Identification Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md The first bit of a NAL unit is the forbidden_zero_bit, followed by two bits for nal_ref_idc, and the remaining five bits indicate the nal_unit_type. For example, a nal_unit_type of '00111' (binary) signifies an SPS NAL unit (type 7). ```binary 01100111 ``` -------------------------------- ### CABAC vs CAVLC Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-cn.md This section provides a practical comparison between CABAC (Context-Adaptive Binary Arithmetic Coding) and CAVLC (Context-Adaptive Variable-Length Coding), two entropy coding methods used in video compression. The examples likely involve encoding the same content with both methods. ```bash ./s/ffmpeg -i input.mp4 -coder cabac output_cabac.mp4 ./s/ffmpeg -i input.mp4 -coder cavlc output_cavlc.mp4 ``` -------------------------------- ### H.264 Bitstream Exploration Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This series of posts delves into the H.264 bitstream, breaking down its structure and explaining various components like NAL units. ```Shell http://gentlelogic.blogspot.com.br/2011/11/exploring-h264-part-2-h264-bitstream.html ``` ```Shell http://yumichan.net/video-processing/video-compression/introduction-to-h264-nal-unit/ ``` -------------------------------- ### Generazione di un video a fotogramma singolo Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-it.md Questo snippet descrive il processo di generazione di un video composto da un singolo fotogramma, utile per testare e analizzare i codec video. Viene fatto riferimento a un esempio pratico per la creazione di tale video. ```bash ffmpeg -f lavfi -i color=c=red:s=1280x720:r=30 -frames:v 1 -c:v libx264 -pix_fmt yuv420p single_frame.mp4 ``` -------------------------------- ### Digital Cameras Explained Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This article explains the fundamental principles behind digital cameras, including how they capture images and video. ```Shell http://www.explainthatstuff.com/digitalcameras.html ``` -------------------------------- ### H.264 Bitstream Exploration Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A blog post series exploring the H.264 bitstream, offering a deep dive into the structure and details of the H.264 video format. ```Shell http://gentlelogic.blogspot.com.br/2011/11/exploring-h264-part-2-h264-bitstream.html ``` -------------------------------- ### Video Encoding and Compression Books Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This section lists several books related to video encoding and compression, covering topics from general principles to specific standards like H.264. ```Shell https://www.amazon.com/Understanding-Compression-Data-Modern-Developers/dp/1491961538/ref=sr_1_1?s=books&ie=UTF8&qid=1486395327&sr=1-1 ``` ```Shell https://www.amazon.com/H-264-Advanced-Video-Compression-Standard/dp/0470516925 ``` ```Shell https://www.amazon.com/Practical-Guide-Video-Audio-Compression/dp/0240806301/ref=sr_1_3?s=books&ie=UTF8&qid=1486396914&sr=1-3&keywords=A+PRACTICAL+GUIDE+TO+VIDEO+AUDIO ``` ```Shell https://www.amazon.com/Video-Encoding-Numbers-Eliminate-Guesswork/dp/0998453005/ref=sr_1_1?s=books&ie=UTF8&qid=1486396940&sr=1-1&keywords=jan+ozer ``` -------------------------------- ### Introduction to Video Compression Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A presentation providing an introduction to video compression, explaining the fundamental principles and techniques used to reduce video data size. ```Shell http://www.slideshare.net/vcodex/introduction-to-video-compression-13394338 ``` -------------------------------- ### Open Source Codecs Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This link points to the Google Source repository for the Alliance for Open Media, likely containing information and code for AV1 and other open codecs. ```Shell https://aomedia.googlesource.com/ ``` -------------------------------- ### Stack Overflow - Understanding H.264 Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This Stack Overflow question aims to help users understand the H.264 video codec, likely covering its structure and encoding principles. ```Shell http://stackoverflow.com/a/24890903 ``` -------------------------------- ### Digital Camera Explanation Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md An explanation of how digital cameras work, covering aspects like image sensors, optics, and the process of capturing digital images. ```Shell http://www.explainthatstuff.com/digitalcameras.html ``` -------------------------------- ### Video Encoding and H.264 Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This resource likely provides information on video encoding, with a specific focus on the H.264 standard. ```Shell http://www.hkvstar.com ``` ```Shell http://www.hometheatersound.com/ ``` -------------------------------- ### Audio Compression Explanation Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A presentation explaining audio compression techniques, likely covering concepts like MP3 and AAC and how they reduce audio file sizes. ```Shell http://www.slideshare.net/MadhawaKasun/audio-compression-23398426 ``` -------------------------------- ### Video Compression Concepts Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This link provides a PDF document that likely covers various concepts related to video compression standards and techniques. ```Shell http://www.springer.com/cda/content/document/cda_downloaddocument/9783642147029-c1.pdf ``` -------------------------------- ### x264 and x265 Comparison Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A Netflix tech blog post comparing x264 and x265, two popular software implementations of H.264 and HEVC video codecs, respectively, focusing on their performance and quality. ```Shell http://techblog.netflix.com/2016/08/a-large-scale-comparison-of-x264-x265.html ``` -------------------------------- ### Transcode Video with FFmpeg (H.264 to H.265) Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/encoding_pratical_examples.md Transcode a video file from H.264 codec to H.265 codec using FFmpeg. ```bash ./s/ffmpeg -i /files/v/small_bunny_1080p_30fps.mp4 -c:v libx265 /files/v/small_bunny_1080p_30fps_h265.mp4 ``` -------------------------------- ### DCT Transform Experience Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Allows users to interactively apply the DCT transform to images, experiment with discarding coefficients, and observe the reconstruction process. This hands-on experience helps in understanding the practical application of DCT for image compression. ```Python from uniform_quantization_experience import DCTExperience # Initialize and run the DCT experience experience = DCTExperience() experience.run() ``` -------------------------------- ### H.264 vs HEVC Comparison Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A presentation comparing H.264 and HEVC video codecs, highlighting their differences in compression efficiency and features. ```Shell http://www.slideshare.net/mwalendo/h264vs-hevc ``` -------------------------------- ### H.264 Encoding Concepts Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A resource explaining H.264 encoding, likely covering the underlying principles and parameters involved in achieving efficient video compression. ```Shell http://www.lighterra.com/papers/videoencodingh264/ ``` -------------------------------- ### Generate Debug Video with FFmpeg Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md Demonstrates how to generate a video visualizing inter prediction and motion vectors using the FFmpeg command-line tool. This is useful for debugging and understanding motion estimation in video encoding. ```bash ffmpeg -i input.mp4 -vf "drawmotionvectors=mode=0:path=path.txt" output.mp4 ``` -------------------------------- ### Generate Video from Sequence of Simple Images (White Background) Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/encoding_pratical_examples.md This command creates a video from a sequence of PNG images that have a white background. The `%d` in the input filename pattern handles sequentially numbered images. ```bash ./s/ffmpeg -i /files/i/solid_background_ball_%d.png -pix_fmt yuv420p /files/v/solid_background_ball_yuv420.mp4 ``` -------------------------------- ### H.264 Encoding Comparison Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This PDF document presents a comparison of various H.264 video codecs, evaluating their performance and compression efficiency. ```Shell http://www.compression.ru/video/codec_comparison/h264_2012/mpeg4_avc_h264_video_codecs_comparison.pdf ``` -------------------------------- ### Video Compression PDF Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This PDF document likely delves into the technical aspects of video compression, potentially covering algorithms and standards. ```Shell https://arxiv.org/pdf/1702.00817v1.pdf ``` -------------------------------- ### Transcode Video with FFmpeg (H.264 to VP9/Vorbis) Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/encoding_pratical_examples.md Transcode a video file from H.264 codec to VP9 video codec and Vorbis audio codec, outputting to a WebM container. ```bash ./s/ffmpeg -i /files/v/small_bunny_1080p_30fps.mp4 -c:v libvpx-vp9 -c:a libvorbis /files/v/small_bunny_1080p_30fps_vp9.webm ``` -------------------------------- ### Generate Video from Sequence of Images (With Background) Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/encoding_pratical_examples.md This command creates a video from a sequence of PNG images that include a background. The `%d` in the input filename pattern handles sequentially numbered images. ```bash ./s/ffmpeg -i /files/i/smw_background_ball_%d.png -pix_fmt yuv420p /files/v/smw_background_ball_yuv420.mp4 ``` -------------------------------- ### Daala Video Codec Demo Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A link to a demo of the Daala video codec, an open-source, royalty-free codec developed by Xiph.Org Foundation, showcasing its capabilities. ```Shell https://ghostarchive.org/archive/0W0d8 ``` -------------------------------- ### Esercitazione su immagini e colori con Jupyter Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-it.md Questo snippet fornisce un link a un notebook Jupyter per sperimentare con immagini e colori utilizzando librerie Python come NumPy e Matplotlib. È utile per comprendere le rappresentazioni delle immagini e le manipolazioni dei colori. ```Python import numpy as np import matplotlib.pyplot as plt # Esempio di caricamento e visualizzazione di un'immagine (richiede un file immagine) # img = plt.imread('nome_file_immagine.png') # plt.imshow(img) # plt.title('Immagine Caricata') # plt.show() # Esempio di creazione di una matrice di colore RGB # red_channel = np.zeros((100, 100), dtype=np.uint8) # green_channel = np.full((100, 100), 255, dtype=np.uint8) # blue_channel = np.zeros((100, 100), dtype=np.uint8) # # rgb_image = np.stack((red_channel, green_channel, blue_channel), axis=-1) # plt.imshow(rgb_image) # plt.title('Immagine Verde') # plt.show() ``` -------------------------------- ### ITU-T Recommendations Index Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A link to the ITU-T recommendations index, allowing users to browse and access various telecommunication standards, including those related to video and audio. ```Shell http://www.itu.int/ITU-T/recommendations/rec.aspx?rec=12904&lang=en ``` -------------------------------- ### Run VMAF Comparison with FFmpeg and VMAF Tool Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/encoding_pratical_examples.md Executes a VMAF (Video Multimethod Assessment Fusion) analysis to compare the perceptual quality of an original video against a transcoded version. It takes the raw YUV data of both videos as input and outputs the results in JSON format. ```shell ./s/vmaf run_vmaf yuv420p 1080 720 /files/v/smallest_bunny_1080p_30fps.yuv /files/v/smallest_bunny_1080p_30fps_vp9.yuv --out-fmt json ``` -------------------------------- ### MediaInfo Tool Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md A link to MediaInfo, a convenient cross-platform tool that displays technical and tag information for video and audio files. It's useful for analyzing media file properties. ```Shell https://mediaarea.net/en/MediaInfo ``` -------------------------------- ### x264 vs x265 Comparison Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README-ko.md This Netflix tech blog post compares the performance and quality of x264 and x265 encoders, providing insights into the trade-offs between H.264 and HEVC compression. ```Shell http://techblog.netflix.com/2016/08/a-large-scale-comparison-of-x264-x265.html ``` -------------------------------- ### Generate Debug Video with FFmpeg Source: https://github.com/leandromoreira/digital_video_introduction/blob/master/README.md This snippet provides a link to generate a video demonstrating macro blocks and their predictions using FFmpeg. It also links to FFmpeg documentation for understanding macroblock types. ```markdown You can [generate a video with macro blocks and their predictions with ffmpeg.](/encoding_pratical_examples.md#generate-debug-video) Please check the ffmpeg documentation to understand the [meaning of each block color](https://trac.ffmpeg.org/wiki/Debug/MacroblocksAndMotionVectors?version=7#AnalyzingMacroblockTypes). ```