I have quite a few rather old “replay” TV recordings from when the preferred format was WMV. Most of these files have two video streams, with a different resolution, which was presumably meant to accomodate lower data transfer rates while keeping everything in a single file on servers with a limited storage capacity. Back then (about 10 years ago — time flies), when I realized that, I tried several tools / methods to process those files by merely removing the extra video stream, so as to shrink their size, but had various issues with various software media players (playback stuttering, erroneous display of time, audio/video desynchronization). The one program that seemed to work flawlessly for that purpose was Windows Media Stream Editor. But it was quite awkward to use, and wasn't able of batch processing.
Fast-forward now — is there a known reliable method to do just that ? (I successfully processed a few such files back then with WMSE, but I have hundreds which are still in their original form, wich 2 video streams.)
As a side question :
I kept some of the original video files successfully processed with WMSE, in a sort of “limbo” folder. As I'm chronically out of free storage space, and as I discovered the concept of delta compression a few months ago, I figured that I would replace those redundant files by a “DIFF” file made with xdelta. I was surprised to find out how small the DIFF files turned out to be : for instance, when comparing a 649669918 bytes (619MB) original WMV file (with 2 video streams), with a 453391320 bytes (432MB) WMSE processed WMV files (with only the larger video stream), xdelta (with the -B parameter set to the size of the source file — in this case 453391320, the default being 67108864) generated a DIFF file with a size of 4071598 bytes (less than 4MB). And yet, I verified, the original (619MB) file can indeed be re-created strictly identical (same MD5) from the WMSE processed file (432MB) and the DIFF file (<4MB), despite the fact that the former contains an extra 187MB video stream. Another original WMV file with a size of 603MB was compared against a 421MB processed file and compressed as a 3MB DIFF file ; again, I verified if the reverse operation was flawless, and it was.
How is that possible ? Could it be that the data corresponding to the smaller resolution VC-1 stream (284x216) is contained within the larger resolution VC-1 stream (640x360), with the data for the larger resolution stream being added on top of that, akin to how so-called “progressive” JPEG pictures can be pre-rendered in low quality before they are fully transferred ?
Another tangential question about delta compression :
When processing TS files remuxed as MP4 / MKV with xdelta, I found out that the size of the generated DIFF file was very inconsistent, with regard to the parameters used. In particular, to achieve the best possible compression, for files which have a very different structure, it is advised to set the -B parameter to the size of the source (with a maximum value of 2GB if I remember correctly). It does shrink the size of the resulting DIFF file usually, but with some files, this setting actually produces significantly larger DIFF files. Does anyone have experience with this tool (or delta compression in general), and have any clue as to what the explanation could be ? And in any case, what would be the best way to process an entire folder with hundreds of TS / MP4 pairs, not knowing which settings will best fit each pair ? I asked about this issue at the dedicated GitHub page, but didn't get a satisfying reply.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 4 of 4
Thread
-
-
Maybe asfbin with -nostr for the unwanted streams numbers.
http://www.radioactivepages.com/asfbindetails.aspx
Should be batchable with commandline version -
If I remember correctly, asfbin was the tool used by an all-in-one TV replay recording software I was using at the time, called TVO (now defunct), to process (“index”) WMV files after download (below are two screenshots I took on 2011/08/19 — that's almost archeology at this point !), and the resulting files exhibited the kind of issues I mentioned above, with common media players in their contemporary versions. For instance I noted in the name of one such file processed by TVO (running ffmpeg then asfbin under-the-hood) : “after TVO processing, stuttering sound in VLC, desynchronized in MPC”, problems that didn't affect files processed with Windows Media Stream Editor. If I play that same file now with VLC Media Player 3.0.16, I don't hear any audio stuttering, but about 1s is missing at the beginning with the picture appearing garbled for about 5s (if I go back to 00:00 with the left arrow key then it plays normally, i.e. not garbled, but a small bit is still missing) ; if I play it in MPC-HC 1.7.8.162 (which is not exactly up-to-date), there's a slight delay (video slightly lagging behind audio), but the same happens with the file processed with WMSE, and the beginning is fine with both files. So I'm not sure if such defects are caused by an improper processing or by intrinsic playback issues with the media player. I have yet to test with a recent version of asfbin.
Automatic “indexing” processing of WMV files by TVO in 2011 (first step with ffmpeg, second step with asfbin) :
-
To elaborate on the dual video stream weirdness, I did the following test.
1) Loaded a 422405918 bytes (402MB) WMV file with two video streams with ffmpeg. It listed 3 streams, 0:0 = 640x360 VC-1 / WMA3 video stream, 0:1 = WMA audio stream, 0:2 = 384x216 VC-1 / WMA3 video stream.
Code:ffmpeg -i "F:\- enregistrements TV\Ce soir ou jamais\F5 20111113 Media le magazine (débat sur Ce soir ou jamais, avec Frédéric Taddéï) - 343289_mediaslemagazine_20111113.wmv" ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.1 (GCC) 20200523 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [wmv3 @ 0000000000152a00] Extra data: 8 bits left, value: 0 [wmv3 @ 0000000000154640] Extra data: 8 bits left, value: 0 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, asf, from 'F:\- enregistrements TV\Ce soir ou jamais\F5 20111113 Media le magazine (d├®bat sur Ce soir ou jamais, avec Fr├®d├®ric Tadd├®├») - 343289_mediaslemagazine_20111113.wmv': Metadata: WMFSDKNeeded : 0.0.0.0000 DeviceConformanceTemplate: MP@ML WMFSDKVersion : 11.0.6002.18005 IsVBR : 0 artist : France T├®l├®visions copyright : France T├®l├®visions Duration: 00:59:47.76, start: 0.000000, bitrate: 941 kb/s Stream #0:0(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x360, 586 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 64 kb/s Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 384x216, 286 kb/s, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn, 1k tbc At least one output file must be specified
Code:ffmpeg -i "F:\- enregistrements TV\Ce soir ou jamais\F5 20111113 Media le magazine (débat sur Ce soir ou jamais, avec Frédéric Taddéï) - 343289 _mediaslemagazine_20111113.wmv" -map 0:0 -c copy "X:\20111113 Media 0;0.wmv" ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.1 (GCC) 20200523 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [wmv3 @ 0000000000372e80] Extra data: 8 bits left, value: 0 [wmv3 @ 0000000000374ac0] Extra data: 8 bits left, value: 0 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, asf, from 'F:\- enregistrements TV\Ce soir ou jamais\F5 20111113 Media le magazine (d├®bat sur Ce soir ou jamais, avec Fr├®d├®ric Tadd├®├») - 343289_mediaslemagazine_20111113.wmv': Metadata: WMFSDKNeeded : 0.0.0.0000 DeviceConformanceTemplate: MP@ML WMFSDKVersion : 11.0.6002.18005 IsVBR : 0 artist : France T├®l├®visions copyright : France T├®l├®visions Duration: 00:59:47.76, start: 0.000000, bitrate: 941 kb/s Stream #0:0(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x360, 586 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 64 kb/s Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 384x216, 286 kb/s, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn, 1k tbc Output #0, asf, to 'X:\20111113 Media 0;0.wmv': Metadata: WMFSDKNeeded : 0.0.0.0000 DeviceConformanceTemplate: MP@ML WMFSDKVersion : 11.0.6002.18005 IsVBR : 0 Author : France T├®l├®visions copyright : France T├®l├®visions WM/EncodingSettings: Lavf58.29.100 Stream #0:0(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 586 kb/s, 25 fps, 25 tbr, 1k tbn, 1k tbc Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help frame=89693 fps=0.0 q=-1.0 Lsize= 258625kB time=00:59:47.68 bitrate= 590.5kbits/s speed=5.04e+03x video:254806kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.498910%
Code:ffmpeg -i "F:\- enregistrements TV\Ce soir ou jamais\F5 20111113 Media le magazine (débat sur Ce soir ou jamais, avec Frédéric Taddéï) - 343289_mediaslemagazine_20111113.wmv" -map 0:1 -c copy "X:\20111113 Media 0;1.wmv" ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.1 (GCC) 20200523 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [wmv3 @ 0000000000542e80] Extra data: 8 bits left, value: 0 [wmv3 @ 0000000000544ac0] Extra data: 8 bits left, value: 0 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, asf, from 'F:\- enregistrements TV\Ce soir ou jamais\F5 20111113 Media le magazine (d├®bat sur Ce soir ou jamais, avec Fr├®d├®ric Tadd├®├») - 343289_mediaslemagazine_20111113.wmv': Metadata: WMFSDKNeeded : 0.0.0.0000 DeviceConformanceTemplate: MP@ML WMFSDKVersion : 11.0.6002.18005 IsVBR : 0 artist : France T├®l├®visions copyright : France T├®l├®visions Duration: 00:59:47.76, start: 0.000000, bitrate: 941 kb/s Stream #0:0(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x360, 586 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 64 kb/s Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 384x216, 286 kb/s, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn, 1k tbc Output #0, asf, to 'X:\20111113 Media 0;1.wmv': Metadata: WMFSDKNeeded : 0.0.0.0000 DeviceConformanceTemplate: MP@ML WMFSDKVersion : 11.0.6002.18005 IsVBR : 0 Author : France T├®l├®visions copyright : France T├®l├®visions WM/EncodingSettings: Lavf58.29.100 Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 64 kb/s Stream mapping: Stream #0:1 -> #0:0 (copy) Press [q] to stop, [?] for help size= 30182kB time=00:59:47.62 bitrate= 68.9kbits/s speed=1.89e+04x video:0kB audio:28040kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 7.639247%
Code:ffmpeg -i "F:\- enregistrements TV\Ce soir ou jamais\F5 20111113 Media le magazine (débat sur Ce soir ou jamais, avec Frédéric Taddéï) - 343289 _mediaslemagazine_20111113.wmv" -map 0:2 -c copy "X:\20111113 Media 0;2.wmv" ffmpeg version 4.2.3 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.1 (GCC) 20200523 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [wmv3 @ 0000000000432e80] Extra data: 8 bits left, value: 0 [wmv3 @ 0000000000434ac0] Extra data: 8 bits left, value: 0 Guessed Channel Layout for Input Stream #0.1 : stereo Input #0, asf, from 'F:\- enregistrements TV\Ce soir ou jamais\F5 20111113 Media le magazine (d├®bat sur Ce soir ou jamais, avec Fr├®d├®ric Tadd├®├») - 343289_mediaslemagazine_20111113.wmv': Metadata: WMFSDKNeeded : 0.0.0.0000 DeviceConformanceTemplate: MP@ML WMFSDKVersion : 11.0.6002.18005 IsVBR : 0 artist : France T├®l├®visions copyright : France T├®l├®visions Duration: 00:59:47.76, start: 0.000000, bitrate: 941 kb/s Stream #0:0(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x360, 586 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn, 1k tbc Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 64 kb/s Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 384x216, 286 kb/s, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn, 1k tbc Output #0, asf, to 'X:\20111113 Media 0;2.wmv': Metadata: WMFSDKNeeded : 0.0.0.0000 DeviceConformanceTemplate: MP@ML WMFSDKVersion : 11.0.6002.18005 IsVBR : 0 Author : France T├®l├®visions copyright : France T├®l├®visions WM/EncodingSettings: Lavf58.29.100 Stream #0:0(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 384x216 [SAR 1:1 DAR 16:9], q=2-31, 286 kb/s, 1k tbr, 1k tbn, 1k tbc Stream mapping: Stream #0:2 -> #0:0 (copy) Press [q] to stop, [?] for help frame= 0 fps=0.0 q=-1.0 Lsize= 1kB time=00:00:00.00 bitrate=N/A speed= 0x video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Code:Général Nom complet : F:\- enregistrements TV\Ce soir ou jamais\F5 20111113 Media le magazine (débat sur Ce soir ou jamais, avec Frédéric Taddéï) - 343289_mediaslemagazine_20111113.wmv Format : Windows Media Taille du fichier : 403 Mio Durée : 59 min 47s Type de débit global : Constant Débit global moyen : 942 kb/s Débit global maximum : 357 kb/s Interprète : France Télévisions Date d'encodage : UTC 2011-11-13 07:36:31.483 Copyright : France Télévisions Vidéo #1 ID : 2 Format : VC-1 Profil du format : MP@ML Identifiant du codec : WMV3 Identifiant du codec/Info : Windows Media Video 9 Identifiant du codec/Suggestion : WMV3 Description du codec : Windows Media Video 9 Durée : 59 min 47s Type de débit : Constant Débit : 586 kb/s Largeur : 640 pixels Hauteur : 360 pixels Format à l'écran : 16/9 Images par seconde : 25,000 Im/s Espace de couleurs : YUV Sous-échantillonnage de la chrominance : 4:2:0 Profondeur des couleurs : 8 bits Type de balayage : Progressif Mode de compression : Avec perte Bits/(Pixel*Image) : 0.102 Taille du flux : 251 Mio (62%) Langue : Anglais (États-Unis) Vidéo #2 ID : 3 Format : VC-1 Profil du format : MP@ML Identifiant du codec : WMV3 Identifiant du codec/Info : Windows Media Video 9 Identifiant du codec/Suggestion : WMV3 Description du codec : Windows Media Video 9 Durée : 59 min 47s Type de débit : Constant Débit : 286 kb/s Largeur : 384 pixels Hauteur : 216 pixels Format à l'écran : 16/9 Images par seconde : 25,000 Im/s Espace de couleurs : YUV Sous-échantillonnage de la chrominance : 4:2:0 Profondeur des couleurs : 8 bits Type de balayage : Progressif Mode de compression : Avec perte Bits/(Pixel*Image) : 0.138 Taille du flux : 122 Mio (30%) Langue : Anglais (États-Unis) Audio ID : 1 Format : WMA Version du format : Version 2 Identifiant du codec : 161 Identifiant du codec/Info : Windows Media Audio Description du codec : Windows Media Audio 9.2 - 64 kbps, 44 kHz, stereo 1-pass CBR Durée : 59 min 47s Type de débit : Constant Débit : 64,0 kb/s Canaux : 2 canaux Echantillonnage : 44,1 kHz Profondeur des couleurs : 16 bits Taille du flux : 27,4 Mio (7%) Langue : Anglais (États-Unis)
How can this be explained ?
Are there other tools better suited than ffmpeg to demux / analyse WMV files and try to understand this ?Last edited by abolibibelot; 20th Sep 2021 at 01:25.
Similar Threads
-
Removing DVD Compression Artifacts from Textured Anime
By shark_bloody in forum RestorationReplies: 7Last Post: 22nd Mar 2021, 11:07 -
Removing the extra duration
By CB94 in forum Newbie / General discussionsReplies: 3Last Post: 15th Sep 2020, 12:15 -
Removing MPEG2 compression artefacts from commercial DVDs?
By Master Tape in forum RestorationReplies: 38Last Post: 17th Aug 2020, 18:27 -
Batch downmixing audio to stereo while just copying video stream?
By bizzybody in forum Video ConversionReplies: 5Last Post: 30th Jan 2019, 04:33 -
(Help Needed with ffmpeg) how do i batch merge audio files to video files
By wander799 in forum Newbie / General discussionsReplies: 5Last Post: 20th Nov 2016, 15:40