
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (66)
-
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...) -
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (6173)
-
FFMPEG overlay by time not working in my case
18 août 2021, par Patel MilanImage Overlay on image and enable by time


ffmpeg -y -loop 1 -i .\1080.png -i .\021.jpg -i .\022.jpg -i .\023.jpg -filter_complex " [1:v]scale=534:810[a]; [2:v]scale=534:810[b]; [3:v]scale=534:810[c]; [0:v][a] overlay=10:8:enable='between(t,0,8)'[o1]; [o1][b] overlay=264:778:enable='between(t,1,8)'[o2]; [o2][c] overlay=534:1524:enable='between(t,2,8)'[o3]" -map "[o3]" -t 8 outImageOverlay.mp4



Log


ffmpeg version 4.3.1-2021-01-01-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, png_pipe, from '.\1080.png':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: png, rgba(pc), 1080x2340, 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, image2, from '.\021.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 286665 kb/s
 Stream #1:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1080x2340, 25 tbr, 25 tbn, 25 tbc
Input #2, image2, from '.\022.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 337493 kb/s
 Stream #2:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1080x2340, 25 tbr, 25 tbn, 25 tbc
Input #3, image2, from '.\023.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 298403 kb/s
 Stream #3:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1080x2340, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
 Stream #0:0 (png) -> overlay:main
 Stream #1:0 (mjpeg) -> scale
 Stream #2:0 (mjpeg) -> scale
 Stream #3:0 (mjpeg) -> scale
 overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 000001cd0b24d000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000001cd0b286080] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 000001cd0b2c9c40] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 000001cd0a848500] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001cd0a848500] profile High, level 5.0, 4:2:0, 8-bit
[libx264 @ 000001cd0a848500] 264 - core 161 r3027 4121277 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'outImageOverlay.mp4':
 Metadata:
 encoder : Lavf58.45.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1080x2340, q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
 Metadata:
 encoder : Lavc58.91.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 200 fps= 43 q=-1.0 Lsize= 208kB time=00:00:07.88 bitrate= 216.6kbits/s speed= 1.7x
video:205kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.538915%
[libx264 @ 000001cd0a848500] frame I:1 Avg QP:10.61 size: 68492
[libx264 @ 000001cd0a848500] frame P:50 Avg QP:16.79 size: 2508
[libx264 @ 000001cd0a848500] frame B:149 Avg QP:29.02 size: 104
[libx264 @ 000001cd0a848500] consecutive B-frames: 0.5% 0.0% 1.5% 98.0%
[libx264 @ 000001cd0a848500] mb I I16..4: 82.0% 10.1% 7.9%
[libx264 @ 000001cd0a848500] mb P I16..4: 0.0% 0.5% 0.1% P16..4: 1.0% 0.0% 0.1% 0.0% 0.0% skip:98.2%
[libx264 @ 000001cd0a848500] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.3% 0.0% 0.0% direct: 0.0% skip:99.7% L0:39.1% L1:60.9% BI: 0.0%
[libx264 @ 000001cd0a848500] 8x8 transform intra:28.0% inter:98.0%
[libx264 @ 000001cd0a848500] coded y,uvDC,uvAC intra: 35.8% 31.1% 23.2% inter: 0.0% 0.1% 0.0%
[libx264 @ 000001cd0a848500] i16 v,h,dc,p: 98% 1% 0% 1%
[libx264 @ 000001cd0a848500] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 17% 15% 7% 7% 9% 8% 8% 11%
[libx264 @ 000001cd0a848500] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 21% 9% 7% 10% 9% 11% 6% 9%
[libx264 @ 000001cd0a848500] i8c dc,h,v,p: 76% 10% 10% 4%
[libx264 @ 000001cd0a848500] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 000001cd0a848500] ref P L0: 90.9% 0.7% 7.0% 1.3%
[libx264 @ 000001cd0a848500] ref B L0: 57.1% 42.0% 0.9%
[libx264 @ 000001cd0a848500] ref B L1: 93.2% 6.8%
[libx264 @ 000001cd0a848500] kb/s:209.46



Overlay Video on Image Command


ffmpeg -y -i love.mp4 -i .\1080.png -i .\021.jpg -i .\022.jpg -i .\023.jpg -loop 1 -i .\020.jpg -filter_complex " [2:v]scale=534:810[a]; [3:v]scale=534:810[b]; [4:v]scale=534:810[c]; [5:v]scale=8000:4000,zoompan=z='min(zoom+0.0020,1.5)':d=417:s=1080x2340,setsar=1[d]; [0:v]scale=1080x2340,setdar=1080:2340,colorkey=0x1CD51A:0.3:0.2[ckout]; [1:v][a] overlay=10:8:enable='between(t,0,8)'[o1]; [o1][b] overlay=264:778:enable='between(t,1,8)'[o2]; [o2][c]overlay=534:1524:enable='between(t,2,8)'[o3]; [d][o3]overlay[o4]; [o4][ckout]overlay[o5]" -map "[o5]" -pix_fmt yuvj422p -t 8 outvideoOverlayInImage.mp4



Log


ffmpeg version 4.3.1-2021-01-01-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'love.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2021-08-17T05:35:07.000000Z
 com.android.version: 11
 Duration: 00:00:06.93, start: 0.000000, bitrate: 538 kb/s
 Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 196 kb/s (default)
 Metadata:
 creation_time : 2021-08-17T05:35:07.000000Z
 handler_name : SoundHandle
 Stream #0:1(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m), 1080x2340, 334 kb/s, SAR 1:1 DAR 6:13, 25 fps, 25 tbr, 90k tbn, 180k tbc (default)
 Metadata:
 creation_time : 2021-08-17T05:35:07.000000Z
 handler_name : VideoHandle
Input #1, png_pipe, from '.\1080.png':
 Duration: N/A, bitrate: N/A
 Stream #1:0: Video: png, rgba(pc), 1080x2340, 25 tbr, 25 tbn, 25 tbc
Input #2, image2, from '.\021.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 286665 kb/s
 Stream #2:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1080x2340, 25 tbr, 25 tbn, 25 tbc
Input #3, image2, from '.\022.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 337493 kb/s
 Stream #3:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1080x2340, 25 tbr, 25 tbn, 25 tbc
Input #4, image2, from '.\023.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 298403 kb/s
 Stream #4:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1080x2340, 25 tbr, 25 tbn, 25 tbc
Input #5, image2, from '.\020.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 184663 kb/s
 Stream #5:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 1080x2340, 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
 Stream #0:1 (h264) -> scale
 Stream #1:0 (png) -> overlay:main
 Stream #2:0 (mjpeg) -> scale
 Stream #3:0 (mjpeg) -> scale
 Stream #4:0 (mjpeg) -> scale
 Stream #5:0 (mjpeg) -> scale
 overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 00000230595cff40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0000023059727e80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 00000230597768c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 00000230597c3c80] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 00000230597faec0] No accelerated colorspace conversion found from yuv420p to argb.
[swscaler @ 0000023059884cc0] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 00000230536e2900] using SAR=1/1
[libx264 @ 00000230536e2900] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000230536e2900] profile High 4:2:2, level 5.0, 4:2:2, 8-bit
[libx264 @ 00000230536e2900] 264 - core 161 r3027 4121277 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'outvideoOverlayInImage.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 com.android.version: 11
 encoder : Lavf58.45.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj422p(pc), 1080x2340 [SAR 1:1 DAR 6:13], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
 Metadata:
 encoder : Lavc58.91.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 200 fps= 11 q=-1.0 Lsize= 1411kB time=00:00:07.88 bitrate=1467.1kbits/s speed=0.435x
video:1408kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.226583%
[libx264 @ 00000230536e2900] frame I:1 Avg QP:20.68 size:121139
[libx264 @ 00000230536e2900] frame P:50 Avg QP:20.09 size: 15622
[libx264 @ 00000230536e2900] frame B:149 Avg QP:24.04 size: 3617
[libx264 @ 00000230536e2900] consecutive B-frames: 0.5% 0.0% 1.5% 98.0%
[libx264 @ 00000230536e2900] mb I I16..4: 8.9% 81.4% 9.7%
[libx264 @ 00000230536e2900] mb P I16..4: 1.5% 1.9% 0.3% P16..4: 21.8% 8.1% 4.7% 0.0% 0.0% skip:61.6%
[libx264 @ 00000230536e2900] mb B I16..4: 0.1% 0.1% 0.0% B16..8: 26.8% 0.7% 0.1% direct: 0.3% skip:72.1% L0:46.3% L1:53.3% BI: 0.3%
[libx264 @ 00000230536e2900] 8x8 transform intra:59.8% inter:84.9%
[libx264 @ 00000230536e2900] coded y,uvDC,uvAC intra: 30.0% 30.8% 13.5% inter: 3.0% 2.2% 0.1%
[libx264 @ 00000230536e2900] i16 v,h,dc,p: 66% 30% 2% 2%
[libx264 @ 00000230536e2900] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 12% 43% 3% 3% 3% 3% 2% 3%
[libx264 @ 00000230536e2900] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 39% 19% 11% 5% 6% 5% 6% 4% 5%
[libx264 @ 00000230536e2900] i8c dc,h,v,p: 57% 19% 21% 3%
[libx264 @ 00000230536e2900] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 00000230536e2900] ref P L0: 73.3% 11.4% 8.9% 6.4%
[libx264 @ 00000230536e2900] ref B L0: 96.2% 3.1% 0.7%
[libx264 @ 00000230536e2900] ref B L1: 95.5% 4.5%
[libx264 @ 00000230536e2900] kb/s:1441.17



Input images and output videos


- 

- 020.jpg
- 021.jpg
- 022.jpg
- 023.jpg
- 1080.png
- outImageOverlay
- outvideoOverlayInImage.mp4
- love.mp4


















image on image overlay is working by enable given time but when video overlay into image is not working correctly


-
How to use audio frame after decode mp3 file using pyav, ffmpeg, python
2 janvier 2021, par Long Tran DaiI am using using python with pyav, ffmpeg to decode mp3 in the memory. I know there are some other way to do it, like pipe ffmpeg command. However, I would like to explore pyav and ffmpeg API. So I have the following code. It works but the sound is very noisy, although hearable :


import numpy as np
import av # to convert mp3 to wav using ffmpeg
import pyaudio # to play music

mp3_path = 'D:/MyProg/python/SauTimThiepHong.mp3'

def decodeStream(mp3_path):
 # Run NOT OK
 
 container = av.open(mp3_path)
 stream = next(s for s in container.streams if s.type == 'audio')
 frame_count = 0
 data = bytearray()
 for packet in container.demux(stream):
 # <class>
 # We need to skip the "flushing" packets that `demux` generates.
 #if frame_count == 5000 : break 
 if packet.dts is None:
 continue
 for frame in packet.decode(): 
 #
 # type(frame) : <class>
 #frame.samples = 1152 : 1152 diem du lieu : Number of audio samples (per channel)
 # moi frame co size = 1152 (diem) * 2 (channels) * 4 (bytes / diem) = 9216 bytes
 # 11021 frames
 #arr = frame.to_ndarray() # arr.nbytes = 9216

 #channels = [] 
 channels = frame.to_ndarray().astype("float16")
 #for plane in frame.planes:
 #channels.append(plane.to_bytes()) #plane has 4 bytes / sample, but audio has only 2 bytes
 # channels.append(np.frombuffer(plane, dtype=np.single).astype("float16"))
 #channels.append(np.frombuffer(plane, dtype=np.single)) # kieu np.single co 4 bytes
 if not frame.is_corrupt:
 #data.extend(np.frombuffer(frame.planes[0], dtype=np.single).astype("float16")) # 1 channel: noisy
 # type(planes) : <class>
 frame_count += 1
 #print( '>>>> %04d' % frame_count, frame) 
 #if frame_count == 5000 : break 
 # mix channels:
 for i in range(frame.samples): 
 for ch in channels: # dec_ctx->channels
 data.extend(ch[i]) #noisy
 #fwrite(frame->data[ch] + data_size*i, 1, data_size, outfile)
 return bytes(data)
</class></class></class>


I use pipe ffmpeg to get decoded data to compare and find they are different :


def RunFFMPEG(mp3_path, target_fs = "44100"):
 # Run OK
 import subprocess
 # init command
 ffmpeg_command = ["ffmpeg", "-i", mp3_path,
 "-ab", "128k", "-acodec", "pcm_s16le", "-ac", "0", "-ar", target_fs, "-map",
 "0:a", "-map_metadata", "-1", "-sn", "-vn", "-y",
 "-f", "wav", "pipe:1"]
 # excute ffmpeg command
 pipe = subprocess.run(ffmpeg_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize= 10**8)
 # debug
 #print(pipe.stdout, pipe.stderr)
 # read signal as numpy array and assign sampling rate
 #audio_np = np.frombuffer(buffer=pipe.stdout, dtype=np.uint16, offset=44)
 #audio_np = np.frombuffer(buffer=pipe.stdout, dtype=np.uint16)
 #sig, fs = audio_np, target_fs
 #return audio_np
 return pipe.stdout[78:] 



Then I use pyaudio to play data and find it very noisy


p = pyaudio.PyAudio()
streamOut = p.open(format=pyaudio.paInt16, channels=2, rate= 44100, output=True)
#streamOut = p.open(format=pyaudio.paInt16, channels=1, rate= 44100, output=True)

mydata = decodeStream(mp3_path)
print("bytes of mydata = ", len(mydata))
#print("bytes of mydata = ", mydata.nbytes)

ffMpegdata = RunFFMPEG(mp3_path)
print("bytes of ffMpegdata = ", len(ffMpegdata)) 
#print("bytes of ffMpegdata = ", ffMpegdata.nbytes)

minlen = min(len(mydata), len(ffMpegdata))
print("mydata == ffMpegdata", mydata[:minlen] == ffMpegdata[:minlen]) # ffMpegdata.tobytes()[:minlen] )

#bytes of mydata = 50784768
#bytes of ffMpegdata = 50784768
#mydata == ffMpegdata False

streamOut.write(mydata)
streamOut.write(ffMpegdata)
streamOut.stop_stream()
streamOut.close()
p.terminate()



Please help me to understand decoded frame of pyav api (after for frame in packet.decode() :). Should it be processed more ? or I have some error ?


It makes me crazy for 3 days. I could not guess where to go.


Thank you very much.


-
avformat/vobsub : fix several issues.
29 septembre 2013, par Clément Bœschavformat/vobsub : fix several issues.
Here is an extract of fate-samples/sub/vobsub.idx, with an additional
text at the end of each line to better identify each bitmap :timestamp : 00:04:55:445, filepos : 00001b000 Ace !
timestamp : 00:05:00:049, filepos : 00001b800 Wake up, honey !
timestamp : 00:05:02:018, filepos : 00001c800 I gotta go to work.
timestamp : 00:05:02:035, filepos : 00001d000 < ???>
timestamp : 00:05:04:203, filepos : 00001d800 Look after Clayton, okay ?
timestamp : 00:05:05:947, filepos : 00001e800 I’ll be back tonight.
timestamp : 00:05:07:957, filepos : 00001f800 Bye ! Love you.
timestamp : 00:05:21:295, filepos : 000020800 Hey, Ace ! What’s up ?
timestamp : 00:05:23:356, filepos : 000021800 Hey, how’s it going ?
timestamp : 00:05:24:640, filepos : 000022800 Remember what today is ? The 3rd !
timestamp : 00:05:27:193, filepos : 000023800 Look over there !
timestamp : 00:05:28:369, filepos : 000024800 Where are they going ?
timestamp : 00:05:28:361, filepos : 000025000 < ???>
timestamp : 00:05:29:946, filepos : 000025800 Let’s go see.
timestamp : 00:05:31:230, filepos : 000026000 I can’t, man. I got Clayton.Note the two "< ???>" : they are basically split subtitles (with the
previous one), which the dvdsub decoder is now supposed to reconstruct
with a previous commit. But also note that while the first chunk has
increasing timestamps,timestamp : 00:05:02:018, filepos : 00001c800
timestamp : 00:05:02:035, filepos : 00001d000...it’s not the case of the second one (and this is not an exception in the
original file) :timestamp : 00:05:28:369, filepos : 000024800
timestamp : 00:05:28:361, filepos : 000025000For the dvdsub decoder, they need to be "filepos’ed" ordered, but the
FFDemuxSubtitlesQueue is timestamps ordered, which is the reason of the
introduction of a sub sort method in the context, to allow giving
priority to the position, and then the timestamps. With that change, the
dvdsub decoder get fed with ordered packets.Now the packet size estimation was also broken : the filepos differences
in the vobsub index defines the full data read between two subtitles
chunks, and it is necessary to take into account what is read by the
mpegps_read_pes_header() function since the length returned by that
function doesn’t count the size of the data it reads. This is fixed with
the introduction of total_read, and old,new_pos. By doing this change,
we can drop the unreliable len16 heuristic and simplify the whole loop.
Note that mpegps_read_pes_header() often read more than one PES packet
(typically in one call it can read 0x1ba and 0x1be chunk along with the
relevant 0x1bd packet), which triggers the "total_read + pkt_size >
psize" check. This is an expected behaviour, which could be avoided by
having a more chunked version of mpegps_read_pes_header().The latest change is the extraction of each stream into its own
subtitles queue. If we don’t do this, the maximum size for a subtitle
chunk is broken, and the previous changes can not work. Having each
stream in a different queue requires some little adjustments in the
seek code of the demuxer.This commit is only meaningful as a whole change and can not be easily
split. The FATE test changes because it uses the vobsub demuxer.