Recherche avancée

Médias (91)

Autres articles (70)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (10529)

  • How to render two videos with alpha channel in real time in pygame ?

    21 décembre 2024, par Francesco Calderone

    I need to play two videos with synched sound in real-time with Pygame.
Pygame does not currently support video streams, so I am using a ffmpeg subprocess.
The first video is a prores422_hq. This is a background video with no alpha channel.
The second video is a prores4444 overlay video with an alpha channel, and it needs to be played in real-tim on top of the first video (with transparency).
All of this needs synched sound from the first base video only.

    


    I have tried many libraries, including pymovie pyav and opencv. The best result so far is to use a subprocess with ffmpeg.

    


    ffmpeg -i testing/stefano_prores422_hq.mov -stream_loop -1 -i testing/key_prores4444.mov -filter_complex "[1:v]format=rgba,colorchannelmixer=aa=1.0[overlay];[0:v][overlay]overlay" -f nut pipe:1 | ffplay -

    


    When running this in the terminal and playing with ffplay, everything is perfect, the overlay looks good, no dropped frames, and the sound is in synch.

    


    However, trying to feed that to pygame via a subprocess creates either video delays and drop frames or audio not in synch.

    


    EXAMPLE ONE :

    


    # SOUND IS NOT SYNCHED - sound is played via ffplay
import pygame
import subprocess
import numpy as np
import sys

def main():
    pygame.init()
    screen_width, screen_height = 1920, 1080
    screen = pygame.display.set_mode((screen_width, screen_height))
    pygame.display.set_caption("PyGame + FFmpeg Overlay with Audio")
    clock = pygame.time.Clock()

    # LAUNCH AUDIO-ONLY SUBPROCESS
    audio_cmd = [
        "ffplay",
        "-nodisp",          # no video window
        "-autoexit",        # exit when video ends
        "-loglevel", "quiet",
        "testing/stefano_prores422_hq.mov"
    ]
    audio_process = subprocess.Popen(audio_cmd)

    # LAUNCH VIDEO-OVERLAY SUBPROCESS
    ffmpeg_command = [
        "ffmpeg",
        "-re",                        # read at native frame rate
        "-i", "testing/stefano_prores422_hq.mov",
        "-stream_loop", "-1",         # loop alpha video
        "-i", "testing/key_prores4444.mov",
        "-filter_complex",
        "[1:v]format=rgba,colorchannelmixer=aa=1.0[overlay];"  # ensure alpha channel
        "[0:v][overlay]overlay",      # overlay second input onto first
        "-f", "rawvideo",             # output raw video
        "-pix_fmt", "rgba",           # RGBA format
        "pipe:1"                      # write to STDOUT
    ]
    video_process = subprocess.Popen(
        ffmpeg_command,
        stdout=subprocess.PIPE,
        stderr=subprocess.DEVNULL
    )
    frame_size = screen_width * screen_height * 4  # RGBA = 4 bytes/pixel
    running = True
    while running:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                running = False
                break

        raw_frame = video_process.stdout.read(frame_size)

        if len(raw_frame) < frame_size:
            running = False
            break
        # Convert raw bytes -> NumPy array -> PyGame surface
        frame_array = np.frombuffer(raw_frame, dtype=np.uint8)
        frame_array = frame_array.reshape((screen_height, screen_width, 4))
        frame_surface = pygame.image.frombuffer(frame_array.tobytes(), 
                                                (screen_width, screen_height), 
                                                "RGBA")
        screen.blit(frame_surface, (0, 0))
        pygame.display.flip()
        clock.tick(25)
    video_process.terminate()
    video_process.wait()
    audio_process.terminate()
    audio_process.wait()
    pygame.quit()
    sys.exit()

if __name__ == "__main__":
    main()



    


    EXAMPLE TWO

    


    # NO VIDEO OVERLAY - SOUND SYNCHED
import ffmpeg
import pygame
import sys
import numpy as np
import tempfile
import os

def extract_audio(input_file, output_file):
    """Extract audio from video file to temporary WAV file"""
    (
        ffmpeg
        .input(input_file)
        .output(output_file, acodec='pcm_s16le', ac=2, ar='44100')
        .overwrite_output()
        .run(capture_stdout=True, capture_stderr=True)
    )

def get_video_fps(input_file):
    probe = ffmpeg.probe(input_file)
    video_info = next(s for s in probe['streams'] if s['codec_type'] == 'video')
    fps_str = video_info.get('r_frame_rate', '25/1')
    num, den = map(int, fps_str.split('/'))
    return num / den

input_file = "testing/stefano_prores422_hq.mov"

# Create temporary WAV file
temp_audio = tempfile.NamedTemporaryFile(suffix='.wav', delete=False)
temp_audio.close()
extract_audio(input_file, temp_audio.name)

probe = ffmpeg.probe(input_file)
video_info = next(s for s in probe['streams'] if s['codec_type'] == 'video')
width = int(video_info['width'])
height = int(video_info['height'])
fps = get_video_fps(input_file)

process = (
    ffmpeg
    .input(input_file)
    .output('pipe:', format='rawvideo', pix_fmt='rgb24')
    .run_async(pipe_stdout=True)
)

pygame.init()
pygame.mixer.init(frequency=44100, size=-16, channels=2, buffer=4096)
clock = pygame.time.Clock()
screen = pygame.display.set_mode((width, height))

pygame.mixer.music.load(temp_audio.name)
pygame.mixer.music.play()

frame_count = 0
start_time = pygame.time.get_ticks()

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.mixer.music.stop()
            os.unlink(temp_audio.name)
            sys.exit()

    in_bytes = process.stdout.read(width * height * 3)
    if not in_bytes:
        break

    # Calculate timing for synchronization
    expected_frame_time = frame_count * (1000 / fps)
    actual_time = pygame.time.get_ticks() - start_time
    
    if actual_time < expected_frame_time:
        pygame.time.wait(int(expected_frame_time - actual_time))
    
    in_frame = (
        np.frombuffer(in_bytes, dtype="uint8")
        .reshape([height, width, 3])
    )
    out_frame = pygame.surfarray.make_surface(np.transpose(in_frame, (1, 0, 2)))
    screen.blit(out_frame, (0, 0))
    pygame.display.flip()
    
    frame_count += 1

pygame.mixer.music.stop()
process.wait()
pygame.quit()
os.unlink(temp_audio.name)


    


    I also tried using pygame mixer and a separate mp3 audio file, but that didn't work either. Any help on how to synch the sound while keeping the playback of both videos to 25 FPS would be greatly appreciated !!!

    


  • Real time playback of two blended videos with alpha channel and synched audio in pygame ?

    22 décembre 2024, par Francesco Calderone

    I need to play two videos with synched sound in real-time with Pygame.
Pygame does not currently support video streams, so I am using a ffmpeg subprocess.
The first video is a prores422_hq. This is a background video with no alpha channel.
The second video is a prores4444 overlay video with an alpha channel, and it needs to be played in real-tim on top of the first video (with transparency).
All of this needs synched sound from the first base video only.

    


    I have tried many libraries, including pymovie pyav and opencv. The best result so far is to use a subprocess with ffmpeg.

    


    ffmpeg -i testing/stefano_prores422_hq.mov -stream_loop -1 -i testing/key_prores4444.mov -filter_complex "[1:v]format=rgba,colorchannelmixer=aa=1.0[overlay];[0:v][overlay]overlay" -f nut pipe:1 | ffplay -

    


    When running this in the terminal and playing with ffplay, everything is perfect, the overlay looks good, no dropped frames, and the sound is in synch.

    


    However, trying to feed that to pygame via a subprocess creates either video delays and drop frames or audio not in synch.

    


    EXAMPLE ONE :

    


    # SOUND IS NOT SYNCHED - sound is played via ffplay
import pygame
import subprocess
import numpy as np
import sys

def main():
    pygame.init()
    screen_width, screen_height = 1920, 1080
    screen = pygame.display.set_mode((screen_width, screen_height))
    pygame.display.set_caption("PyGame + FFmpeg Overlay with Audio")
    clock = pygame.time.Clock()

    # LAUNCH AUDIO-ONLY SUBPROCESS
    audio_cmd = [
        "ffplay",
        "-nodisp",          # no video window
        "-autoexit",        # exit when video ends
        "-loglevel", "quiet",
        "testing/stefano_prores422_hq.mov"
    ]
    audio_process = subprocess.Popen(audio_cmd)

    # LAUNCH VIDEO-OVERLAY SUBPROCESS
    ffmpeg_command = [
        "ffmpeg",
        "-i", "testing/stefano_prores422_hq.mov",
        "-stream_loop", "-1",         # loop alpha video
        "-i", "testing/key_prores4444.mov",
        "-filter_complex",
        "[1:v]format=rgba,colorchannelmixer=aa=1.0[overlay];"  # ensure alpha channel
        "[0:v][overlay]overlay",      # overlay second input onto first
        "-f", "rawvideo",             # output raw video
        "-pix_fmt", "rgba",           # RGBA format
        "pipe:1"                      # write to STDOUT
    ]
    video_process = subprocess.Popen(
        ffmpeg_command,
        stdout=subprocess.PIPE,
        stderr=subprocess.DEVNULL
    )
    frame_size = screen_width * screen_height * 4  # RGBA = 4 bytes/pixel
    running = True
    while running:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                running = False
                break

        raw_frame = video_process.stdout.read(frame_size)

        if len(raw_frame) < frame_size:
            running = False
            break
        # Convert raw bytes -> NumPy array -> PyGame surface
        frame_array = np.frombuffer(raw_frame, dtype=np.uint8)
        frame_array = frame_array.reshape((screen_height, screen_width, 4))
        frame_surface = pygame.image.frombuffer(frame_array.tobytes(), 
                                                (screen_width, screen_height), 
                                                "RGBA")
        screen.blit(frame_surface, (0, 0))
        pygame.display.flip()
        clock.tick(25)
    video_process.terminate()
    video_process.wait()
    audio_process.terminate()
    audio_process.wait()
    pygame.quit()
    sys.exit()

if __name__ == "__main__":
    main()



    


    EXAMPLE TWO

    


    # NO VIDEO OVERLAY - SOUND SYNCHED
import ffmpeg
import pygame
import sys
import numpy as np
import tempfile
import os

def extract_audio(input_file, output_file):
    """Extract audio from video file to temporary WAV file"""
    (
        ffmpeg
        .input(input_file)
        .output(output_file, acodec='pcm_s16le', ac=2, ar='44100')
        .overwrite_output()
        .run(capture_stdout=True, capture_stderr=True)
    )

def get_video_fps(input_file):
    probe = ffmpeg.probe(input_file)
    video_info = next(s for s in probe['streams'] if s['codec_type'] == 'video')
    fps_str = video_info.get('r_frame_rate', '25/1')
    num, den = map(int, fps_str.split('/'))
    return num / den

input_file = "testing/stefano_prores422_hq.mov"

# Create temporary WAV file
temp_audio = tempfile.NamedTemporaryFile(suffix='.wav', delete=False)
temp_audio.close()
extract_audio(input_file, temp_audio.name)

probe = ffmpeg.probe(input_file)
video_info = next(s for s in probe['streams'] if s['codec_type'] == 'video')
width = int(video_info['width'])
height = int(video_info['height'])
fps = get_video_fps(input_file)

process = (
    ffmpeg
    .input(input_file)
    .output('pipe:', format='rawvideo', pix_fmt='rgb24')
    .run_async(pipe_stdout=True)
)

pygame.init()
pygame.mixer.init(frequency=44100, size=-16, channels=2, buffer=4096)
clock = pygame.time.Clock()
screen = pygame.display.set_mode((width, height))

pygame.mixer.music.load(temp_audio.name)
pygame.mixer.music.play()

frame_count = 0
start_time = pygame.time.get_ticks()

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.mixer.music.stop()
            os.unlink(temp_audio.name)
            sys.exit()

    in_bytes = process.stdout.read(width * height * 3)
    if not in_bytes:
        break

    # Calculate timing for synchronization
    expected_frame_time = frame_count * (1000 / fps)
    actual_time = pygame.time.get_ticks() - start_time
    
    if actual_time < expected_frame_time:
        pygame.time.wait(int(expected_frame_time - actual_time))
    
    in_frame = (
        np.frombuffer(in_bytes, dtype="uint8")
        .reshape([height, width, 3])
    )
    out_frame = pygame.surfarray.make_surface(np.transpose(in_frame, (1, 0, 2)))
    screen.blit(out_frame, (0, 0))
    pygame.display.flip()
    
    frame_count += 1

pygame.mixer.music.stop()
process.wait()
pygame.quit()
os.unlink(temp_audio.name)


    


    I also tried using pygame mixer and a separate mp3 audio file, but that didn't work either. Any help on how to synch the sound while keeping the playback of both videos to 25 FPS would be greatly appreciated !!!

    


  • ffmpeg stream decoding - artefacts when not using ffplay

    18 décembre 2018, par Lucker10

    I stream a video capture via RTP using libx264. For now, I just stream to localhost.
    For watching the stream, I use the ffmpeg library. When I set the GOP size greater than 1 (only I frames), I get artefacts on the receiver side received image. The strange thing is, when I use ffplay, the image is perfect like original. What am I doing wrong ?

    Settings for encoding

    output_codec_ctx->bit_rate = 5000000;
    output_codec_ctx->width = 1920;
    output_codec_ctx->height = 1080;
    output_codec_ctx->time_base.den = 30; // frames per second
    output_codec_ctx->time_base.num = 1;
    output_codec_ctx->gop_size = 10; // gop size
    output_codec_ctx->max_b_frames = 0; // B frames
    output_codec_ctx->pix_fmt = AV_PIX_FMT_YUV420P; // output pixel format
    output_codec_ctx->codec_type = AVMEDIA_TYPE_VIDEO;

    av_opt_set(output_codec_ctx->priv_data, "preset", "ultrafast", 0);
    av_opt_set(output_codec_ctx->priv_data, "tune", "zerolatency", 0);

    Code for decoding

    AVFormatContext *pFormatCtx;
    AVCodecContext *input_codec_ctx;
    AVCode *pCodec;
    avdevice_register_all(); // for device
    avformat_network_init();
    pFormatCtx = avformat_alloc_context();
    input_codec_ctx = avcodec_alloc_context3(nullptr);
    AVDictionary *options = nullptr;
    av_dict_set(&options, "protocol_whitelist", "file,udp,rtp", 0);
    av_dict_set(&options, "fflags", "nobuffer",0);

    avformat_open_input(&pFormatCtx, "rtp://127.0.0.1:49990", nullptr, &options);

    avformat_find_stream_info(pFormatCtx, nullptr);
    for (uint i = 0; i < pFormatCtx->nb_streams; i++)
    {
      if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
      {
        videoStream = static_cast<int>(i);
        break;
      }

    }

    av_read_play(pFormatCtx);    //play stream
    pCodec = avcodec_find_decoder(pFormatCtx->streams[videoStream]->codecpar->codec_id);
    AVCodecParameters *codec_param = pFormatCtx->streams[videoStream]->codecpar;
    avcodec_parameters_to_context(input_codec_ctx, codec_param);
    avcodec_open2(input_codec_ctx, pCodec, nullptr);

    AVPacket packet;
    AVPacket *pkt  = &amp;packet;
    AVFrame *frame;
    frame = av_frame_alloc();

    av_init_packet(pkt);
    pkt->data = nullptr;    // packet data will be allocated by the encoder
    pkt->size = 0;

    while(true){
       av_read_frame(pFormatCtx,pkt);
       avcodec_send_packet(input_codec_ctx,pkt);
       avcodec_receive_frame(input_codec_ctx,frame);
    }
    </int>

    Initialization and stuff omitted. Console output for custom decoding :

    NULL @ 0x1fb7b80] Opening 'stream.sdp' for reading
    [sdp @ 0x1fb7b80] Format sdp probed with size=2048 and score=50
    [sdp @ 0x1fb7b80] video codec set to: h264
    [sdp @ 0x1fb7b80] RTP Packetization Mode: 1
    [udp @ 0x1f34140] end receive buffer size reported is 131072
    [udp @ 0x1fb8e40] end receive buffer size reported is 131072
    [sdp @ 0x1fb7b80] setting jitter buffer size to 500

    Success !
    [sdp @ 0x1fb7b80] Before avformat_find_stream_info() pos: 181 bytes read:181 seeks:0 nb_streams:1
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [AVBSFContext @ 0x1fa5880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] Format yuv420p chosen by get_format().
    [h264 @ 0x1fa51c0] Reinit context to 1920x1088, pix_fmt: yuv420p
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 57 packets
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] Invalid level prefix
    [h264 @ 0x1fa51c0] error while decoding MB 2 36
    [h264 @ 0x1fa51c0] concealing 3887 DC, 3887 AC, 3887 MV errors in I frame
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 155 packets
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] corrupted macroblock 32 41 (total_coeff=-1)
    [h264 @ 0x1fa51c0] error while decoding MB 32 41
    [h264 @ 0x1fa51c0] concealing 3257 DC, 3257 AC, 3257 MV errors in I frame
    [h264 @ 0x1fa51c0] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1fa51c0] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 52 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 51 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 10 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 50 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 52 packets
    [sdp @ 0x1fb7b80] All info found
    [sdp @ 0x1fb7b80] After avformat_find_stream_info() pos: 181 bytes read:181 seeks:0 frames:28
    found video stream

    The number of elements in stream is  1

    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] Format yuv420p chosen by get_format().
    [h264 @ 0x1ee3880] Reinit context to 1920x1088, pix_fmt: yuv420p
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 256 packets
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] Invalid level prefix
    [h264 @ 0x1ee3880] error while decoding MB 119 41
    [h264 @ 0x1ee3880] concealing 3170 DC, 3170 AC, 3170 MV errors in I frame
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 5 packets
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 4 packets
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] out of range intra chroma pred mode
    [h264 @ 0x1ee3880] error while decoding MB 100 56
    [h264 @ 0x1ee3880] corrupted macroblock 84 65 (total_coeff=-1)
    [h264 @ 0x1ee3880] error while decoding MB 84 65
    [h264 @ 0x1ee3880] concealing 754 DC, 754 AC, 754 MV errors in I frame
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 160 packets
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] corrupted macroblock 17 36 (total_coeff=-1)
    [h264 @ 0x1ee3880] error while decoding MB 17 36
    [h264 @ 0x1ee3880] concealing 3872 DC, 3872 AC, 3872 MV errors in I frame
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [sdp @ 0x1fb7b80] max delay reached. need to consume packet
    [sdp @ 0x1fb7b80] RTP: missed 53 packets
    [h264 @ 0x1ee3880] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0x1ee3880] corrupted macroblock 62 39 (total_coeff=-1)
    [h264 @ 0x1ee3880] error while decoding MB 62 39
    [h264 @ 0x1ee3880] concealing 3467 DC, 3467 AC, 3467 MV errors in I frame