Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
12-27-2021, 10:40 AM
#1
Member
Registered: Feb 2013
Posts: 58
Rep:
How to extract video from corrupt recording?
Hi forum,
VLC can play live TV from my satellite tuner card and write it to disk at the same time. The resulting file is of type TransportStream and contains many things. Here is the output of
ffmpeg -i
Code:
user@host:/opt/temp$ ffmpeg -i vlc-record-2021-11-26-22h46m06s-dvb-s___frequency\=12544750-.ts
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[mpeg2video @ 0x5637d3d22e80] Invalid frame dimensions 0x0.
Last message repeated 10 times
[mpegts @ 0x5637d3cf8600] Could not find codec parameters for stream 4 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'vlc-record-2021-11-26-22h46m06s-dvb-s___frequency=12544750-.ts':
Duration: N/A, start: 90593.985444, bitrate: N/A
Program 17500
Metadata:
service_name : SAT.1
service_provider: ProSiebenSat.1
Program 17501
Metadata:
service_name : ProSieben
service_provider: ProSiebenSat.1
Stream #0:0[0x21](deu,deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
Stream #0:1[0x1ff]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:2[0x200](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
Stream #0:3[0x203](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 384 kb/s (clean effects)
Stream #0:4[0x205]: Unknown: none ([5][0][0][0] / 0x0005)
Program 17502
Metadata:
service_name : kabel eins
service_provider: ProSiebenSat.1
Program 17503
Metadata:
service_name : WELT
service_provider: ProSiebenSat.1
Program 17504
Metadata:
service_name : SAT.1 Gold
service_provider: ProSiebenSat.1
Program 17505
Metadata:
service_name : Pro7 MAXX
service_provider: ProSiebenSat.1
Program 17507
Metadata:
service_name : SAT.1 Bayern
service_provider: ProSiebenSat.1
Program 17508
Metadata:
service_name : SAT.1 NRW
service_provider: ProSiebenSat.1
Program 17509
Metadata:
service_name : kabel eins Doku
service_provider: ProSiebenSat.1
Program 17506
Metadata:
service_name : .
service_provider: ProSiebenSat.1
At least one output file must be specified
Usually, I would load that file into avidemux, cut out the commercials and save as an avi. With the encoder settings audio: copy and video: copy, I get a video file that contains the video stream and its matching audio streams. All the other programs from the same stream are then gone and that is OK with me.
This time, the video froze a few seconds into the recording and the file is huge (45 GB for 2 hours, I would have expected ~2 GB). Playing this .ts file also freezes after a few seconds.
Given the video and audio data is in there somewhere, can I extract it and mux it into a valid .avi file?
Is ffmpeg's info for the individual streams of program 17501 (Pro7) of any help here?
12-27-2021, 11:27 AM
#2
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,159
From what I can see.
First, rename that filename mess
Code:
mv "vlc-record-2021-11-26-22h46m06s-dvb-s___frequency\=12544750-.ts" myfile.ts
Then see if you can dump 5 min of it. 0:0 is subs, 0:1 is vid, 0:2 is audio.
Code:
ffmpeg -i myfile.ts -t 00:05:00 -map 0:1 -map 0:2 -c:a copy -c:v copy myfile.mpeg
It looks like it is mpeg2 video and mp2 audio.
Quote:
can I extract it and mux it into a valid .avi file
Yes, you can put into a container whatever the container format supports.
12-27-2021, 11:35 AM
#3
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,159
If it's not a corrupt mpeg2 transport stream, then see if you can re-encode 5 min of it.
Code:
ffmpeg -i myfile.mpeg -c:a aac -b:a 192k -c:v libx264 -crf 18 -preset slow -s 720x576 myfile.mp4
Then you'll want to find all of the commercials, and cut them out. Right?
If you get stuck, Tell what you have.
Code:
ffprobe -probesize 1000000000 -analyzeduration 100000000 -i myfile.ts
12-27-2021, 06:59 PM
#4
Member
Registered: Feb 2013
Posts: 58
Original Poster
Rep:
The .ts file at hand is VLC's dump of a DVB-S stream.
The first attempt (extract 5 minutes) works perfectly. But trying to do the whole thing (extract 3 hours) gives an .mpeg file that ends after 6 minutes and 4 seconds and is 132 MB in size.
Code:
user@host:/opt/temp$ ffmpeg -i myfile.ts -t 03:00:00 -map 0:1 -map 0:2 -c:a copy -c:v copy myfile.mpeg
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[mpeg2video @ 0x55dddc15dd40] Invalid frame dimensions 0x0.
Last message repeated 10 times
[mpegts @ 0x55dddc133740] Could not find codec parameters for stream 4 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'vlc-record-2021-11-26-22h46m06s-dvb-s___frequency=12544750-.ts':
Duration: N/A, start: 90593.985444, bitrate: N/A
Program 17500
Metadata:
service_name : SAT.1
service_provider: ProSiebenSat.1
Program 17501
Metadata:
service_name : ProSieben
service_provider: ProSiebenSat.1
Stream #0:0[0x21](deu,deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
Stream #0:1[0x1ff]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:2[0x200](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
Stream #0:3[0x203](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, stereo, fltp, 384 kb/s (clean effects)
Stream #0:4[0x205]: Unknown: none ([5][0][0][0] / 0x0005)
Program 17502
Metadata:
service_name : kabel eins
service_provider: ProSiebenSat.1
Program 17503
Metadata:
service_name : WELT
service_provider: ProSiebenSat.1
Program 17504
Metadata:
service_name : SAT.1 Gold
service_provider: ProSiebenSat.1
Program 17505
Metadata:
service_name : Pro7 MAXX
service_provider: ProSiebenSat.1
Program 17507
Metadata:
service_name : SAT.1 Bayern
service_provider: ProSiebenSat.1
Program 17508
Metadata:
service_name : SAT.1 NRW
service_provider: ProSiebenSat.1
Program 17509
Metadata:
service_name : kabel eins Doku
service_provider: ProSiebenSat.1
Program 17506
Metadata:
service_name : .
service_provider: ProSiebenSat.1
[mpeg @ 0x55dddc1cb5c0] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'myfile.mpeg':
Metadata:
encoder : Lavf58.29.100
Stream #0:0: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1(deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x55dddc133740] PES packet size mismatch
Last message repeated 2 times
frame= 9118 fps= 15 q=-1.0 Lsize= 129184kB time=00:06:05.45 bitrate=2895.8kbits/s speed=0.597x
video:119980kB audio:8553kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.506731%
I also tried to extract from a later point in time onwards
Code:
user@host:/opt/temp$ ffmpeg -i myfile.ts -ss 0:07:00 -t 0:10:00 -map 0:1 -map 0:2 -c:a copy -c:v copy myfile.mpeg
and got
Code:
[mpeg @ 0x55feb3e9e6c0] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'myfile3.mpeg':
Metadata:
encoder : Lavf58.29.100
Stream #0:0: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
Stream #0:1(deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
Stream mapping:
Stream #0:1 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x55feb3e69780] PES packet size mismatch
Last message repeated 2 times
frame= 0 fps=0.0 q=-1.0 Lsize= 0kB 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
and an empty output file.
12-28-2021, 06:48 AM
#5
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,159
Put a valid time base on the original. Transport streams don't have one. There is no time index for a player or ffmpeg to go n.
First thing that I do when working with digital television transport streams that have been dumped to file.
Code:
ffmpeg -i myfile.ts -c:a copy -c:v copy myfile.mp4
Then work on myfile.mp4. ffmpeg will create a valid time index.
Last edited by teckk; 12-28-2021 at 06:49 AM .
1 members found this post helpful.
12-28-2021, 03:02 PM
#6
Member
Registered: Feb 2013
Posts: 58
Original Poster
Rep:
That didn't work. The resulting .mp4 file is also 130 MB in size and stops at 6 minutes 4 seconds. There is something in that recording that hinders ffmpeg from doing its normal job. Btw, I have 3 recordings with these symptoms and many others that did work as they should.
Can we use the first 6 minutes' info to tell ffmpeg how to extract the rest (assuming that codec, bitrate, whatever doesn't change during a TV show)?
I've seen something like that (in GIMP, I think) for images instead of videos. There, you tell the program how an image is encoded and it can then load a raw data chunk without header as an image file. Is there something similar for video?
12-29-2021, 08:12 AM
#7
LQ Addict
Registered: Dec 2013
Posts: 19,872
Random suggestions:
If VLC wrote that, can it also read it? And possibly convert it?
Are those first 6 minutes OK?
Do some more analysis with ffprobe as suggested in post #3.
Try
this (helped me to fix a stream recording).
12-29-2021, 09:09 AM
#8
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,159
You can also skip 2 or 3 seconds in the video and go around the bad spot. It'll make you miss 3 seconds of video when you put the segments together, but you won't loose the whole thing. Depends on how important the video is to you. Bad segments can happen on an over the air broadcast because a few bits are lost. Ever watch a tv channel and it pixelates for a second? That will be a bad spot if you are dumping to file. And it may be unrecoverable. The bits aren't there. Not like a stubborn DVD where you can use ddrescue and do pass after pass and try to read the bits.
ffplay works best for this. I find that mplayer, mpv, index a hair different than ffmpeg. ffplay is ffmpeg of course.
Find out where the bad spot starts/stops exactly.
Find the bad spot.
Code:
ffplay -ss 00:06:02 myfile.mp4
ffplay -ss 00:06:03 myfile.mp4
ffplay -ss 00:06:04 myfile.mp4
ffplay -ss 00:06:05 myfile.mp4
ffplay -ss 00:06:06 myfile.mp4
...
Cut out the bad spot
Code:
ffmpeg -i myfile.mp4 -t 00:06:03 ..... seg1.mp4
ffmpeg -i myfile.mp4 -ss 00:06:06 ..... seg2.mp4
Make a concat file for ffmpeg to use.
Name the segments in confile with this format
Code:
file 'seg1.mp4'
file 'seg2.mp4'
Put it back together
Code:
ffmpeg -f concat -i confile -c:a copy -c:v copy final.mp4
@ondoho
There is another ffmpeg switch that I did not know about. One could almost do a masters thesis on that tool.
12-30-2021, 10:33 AM
#9
Member
Registered: Feb 2013
Posts: 58
Original Poster
Rep:
Quote:
Originally Posted by
ondoho
If VLC wrote that, can it also read it? And possibly convert it?
Are those first 6 minutes OK?
It can read, but only up to that 6 minutes 4 seconds point. Playback stops there.
Quote:
Originally Posted by
ondoho
Do some more analysis with ffprobe as suggested in post #3.
That gives nearly the same output as ffmpeg itself:
Code:
luker@john:/opt/temp$ ffprobe -probesize 1000000000 -analyzeduration 100000000 -i friendlyName.ts
ffprobe version 4.2.4-1ubuntu0.1 Copyright (c) 2007-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=1ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libaribb24 --enable-liblensfun --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
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
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[mpeg2video @ 0x56099c9807c0] Invalid frame dimensions 0x0.
Last message repeated 10 times
[mpegts @ 0x56099c955f40] PES packet size mismatch
Last message repeated 1 times
[mpegts @ 0x56099c955f40] Could not find codec parameters for stream 4 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'friendlyName.ts':
Duration: N/A, start: 90593.985444, bitrate: N/A
Program 17500
Metadata:
service_name : SAT.1
service_provider: ProSiebenSat.1
Program 17501
Metadata:
service_name : ProSieben
service_provider: ProSiebenSat.1
Stream #0:0[0x21](deu,deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
Stream #0:1[0x1ff]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:2[0x200](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
Stream #0:3[0x203](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, 5.1(side), fltp, 384 kb/s (clean effects)
Stream #0:4[0x205]: Unknown: none ([5][0][0][0] / 0x0005)
Program 17502
Metadata:
service_name : kabel eins
service_provider: ProSiebenSat.1
Program 17503
Metadata:
service_name : WELT
service_provider: ProSiebenSat.1
Program 17504
Metadata:
service_name : SAT.1 Gold
service_provider: ProSiebenSat.1
Program 17505
Metadata:
service_name : Pro7 MAXX
service_provider: ProSiebenSat.1
Program 17507
Metadata:
service_name : SAT.1 Bayern
service_provider: ProSiebenSat.1
Program 17508
Metadata:
service_name : SAT.1 NRW
service_provider: ProSiebenSat.1
Program 17509
Metadata:
service_name : kabel eins Doku
service_provider: ProSiebenSat.1
Program 17506
Metadata:
service_name : .
service_provider: ProSiebenSat.1
Unsupported codec with id 0 for input stream 4
Quote:
Originally Posted by
ondoho
Try
this (helped me to fix a stream recording).
That created a 2 GB file that plays for exactly 6 minutes 4 seconds.
Quote:
Originally Posted by
teckk
Find the bad spot.
Code:
ffplay -ss 00:06:02 myfile.mp4
...
I have to start with the .ts file because transforming it into .mp4 or .mkv or .avi is what doesn't work in the first place. So for segment 2 starting times, that command hangs for hours without ever playing anything.
I fear that might be broken beyond repair. Or do you know yet another way to get the video into a file?
12-30-2021, 12:40 PM
#10
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,159
I explained that in post 8. Go around the bad spot. Find out where the bad spot starts/stops. If the bad spot is 10 sec or 1 1/2 minute, then you'll have to loose that.
Last edited by teckk; 12-30-2021 at 12:41 PM .
1 members found this post helpful.
01-01-2022, 08:32 AM
#11
Member
Registered: Feb 2013
Posts: 58
Original Poster
Rep:
Even half an hour is not long enough after the 6 minutes mark to get a nonzero sized output file.
I also tried to copy part of the file not with ffmpeg and its companions but on the file level with
Code:
tail -c +200M myfile.ts > myend.ts
in the hope that a stream doesn't have a header anyway and should therefore work, but it doesn't.
01-01-2022, 09:10 AM
#12
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,159
Could be that the media dump is simply defective. Or, does the steam have any kind of DRM in it?
You could try mapping streams to see which one ffmpeg does not like.
Code:
Stream #0:0[0x21](deu,deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250
Stream #0:1[0x1ff]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:2[0x200](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
Stream #0:3[0x203](deu): Audio: ac3 ([6][0][0][0] / 0x0006), 48000 Hz, 5.1(side), fltp, 384 kb/s (clean effects)
Stream #0:4[0x205]: Unknown: none ([5][0][0][0] / 0x0005)
If it's the video then you're done. If it was an audio stream or sub stream that ffmpeg crashes on, you could exclude that.
Code:
#Just the video
ffmpeg -i myfile.ts -map 0:1 -c:a copy -c:v copy out.mp4
#Just the ac3 audio.
ffmpeg -i myfile.ts -map 0:3 -c:a copy -c:v copy out.m4a
ffmpeg -vn -c:a copy out.mp4
ffmpeg -an -c:v copy out.mp4
For what it's worth. I use v4l utils to dump tv transport streams all the time with no problem. Other than the signal falling out causing a bad spot.
https://linuxtv.org/
Make a channels conf file, then "zap" a channel, then dump stream to file.
You need a different channels.conf for over the air, cable, satellite
Code:
conf="$HOME/.mplayer/dvb_channel.conf"
dvbv5-zap -ssrc "$conf" 14.1 -o tv_stream.ts
All times are GMT -5. The time now is 03:53 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News