I am using ffmpeg, but please bear with me cause I am absolutely newbie
The file I got:
Duration: 01:08:47.98, start: 12222.532978, bitrate: 4463 kb/sI need to extract the stream #0:3
Program 37
Stream #0:0[0x2f5]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg, top first), 704x576 [....]
Stream #0:1[0x2f6](dan): Audio: aac_latm (HE-AAC) ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
Stream #0:2[0x2f7](dan): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
Stream #0:3[0x2f8](dan): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:4[0x2f9](dan): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) (hearing impaired)
Stream #0:5[0x2fa]: Unknown: none ([5][0][0][0] / 0x0005)
Stream #0:6[0x2fb]: Unknown: none ([11][0][0][0] / 0x000B
I have been trying this (My file is named "film"):
ffmpeg -i film.ts -map 0:3 -scodec dvdsub film.srtIt does not work
+ Reply to Thread
Results 1 to 23 of 23
-
-
The full eror discription is a "little" long
:
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] decode_slice_header error
[h264 @ 00000000025e32c0] no frame!
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] decode_slice_header error
[h264 @ 00000000025e32c0] no frame!
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] decode_slice_header error
[h264 @ 00000000025e32c0] no frame!
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] decode_slice_header error
[h264 @ 00000000025e32c0] no frame!
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] decode_slice_header error
[h264 @ 00000000025e32c0] no frame!
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] decode_slice_header error
[h264 @ 00000000025e32c0] no frame!
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] SPS unavailable in decode_picture_timing
[h264 @ 00000000025e32c0] non-existing PPS 0 referenced
[h264 @ 00000000025e32c0] decode_slice_header error
[h264 @ 00000000025e32c0] no frame!
[h264 @ 00000000025e32c0] mmco: unref short failure
[h264 @ 00000000025e32c0] number of reference frames (0+4) exceeds max (3; probably corrupt input), discarding one
[aac_latm @ 00000000025e3f40] element type mismatch 1 != 0
[mpegts @ 00000000001763a0] start time for stream 3 is not set in estimate_timings_from_pts
[mpegts @ 00000000001763a0] start time for stream 4 is not set in estimate_timings_from_pts
[mpegts @ 00000000001763a0] PES packet size mismatch
Last message repeated 1 times
[mpegts @ 00000000001763a0] Could not find codec parameters for stream 5 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 00000000001763a0] Could not find codec parameters for stream 6 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options -
Thanks - But I first would like to know if this is the right "command" and "syntax":
ffmpeg -i film.ts -map 0:3 -scodec dvdsub film.srt
-
DVB subs are not DVD subs.
While similar (image based), they're way more complicated, especially regarding timing and presentation.
Plus you'd need to OCR them to get a SRT. Something which FFMPEG isn't doing at all, afaik.
Maybe you're lucky and the Teletext-stream offers subtitles, which you can try to extract using ccextractor. -
I believe you are supposed to do something crazy like
-c:s dvdsub -f rawvideo film.sup
or
-c:s dvbsub -f rawvideo film.sup
Interestingly, ffmpeg doc knows about -f dvd_subtitle and -f dvb_subtitle but they don't really result in anything useful either, from what I can see.
It creates files (well, maybe not for your specific sample if there are other problems) but they can't usually be read. And like T-buch said if you want text subtitles (srt) you need to OCR anyways. -
Thanks... I guess
cause i am a little confused ... Why?
Because when I do this:
ffmpeg -i film.ts -map 0:0 -map 0:1 -map 0:3 -vcodec copy -acodec copy -scodec dvdsub film.mkv
I got this results
Input #0, matroska,webm, from 'film.mkv':
Metadata:
ENCODER : Lavf57.56.100
Duration: 00:45:55.11, start: 0.462000, bitrate: 2820 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt470bg, top first), 704x576 [SAR 16:11 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
Metadata:
DURATION : 00:45:54.997000000
Stream #0:1(dan): Audio: aac_latm (HE-AAC) ([2][22][0][0] / 0x1602), 48000 Hz, stereo, fltp (default)
Metadata:
DURATION : 00:45:54.251000000
Stream #0:2(dan): Subtitle: dvd_subtitle (default)
Metadata:
ENCODER : Lavc57.64.101 dvdsub
DURATION : 00:45:55.110000000
Everything is fine but it stops at 45:00 (the original file is 01:08:47)
Error:[matroska @ 00000000028d0660] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[matroska @ 00000000028d0660] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument -
Try:
ffmpeg -fflags +genpts -i film.ts -map 0:0 -map 0:1 -map 0:3 -c:v copy -c:a copy -c:s dvdsub film.mkv
I assume you want to hardcode the subs in HandBrake? ffmpeg can do that itself though I haven't tested it with such ts files.
https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideoLast edited by sneaker; 11th Mar 2017 at 07:37.
-
Thanks again - I wil try that
What I want is to convert the MPEG-TS-file (kind of AVC H.264 codec) to MKV (H.265), Trimmed (The last of the file must be cut away - so its 0:00:00 - 0.59.01 (H.MM.SS)) with the the ability to choose subtiles (so no Hardcore/burn in subtitle) -
Problem is the latm_aac which isn't extracted by ffmpeg. You can either convert (to e.g. aac or opus):
ffmpeg -i film.ts -map 0:0 -map 0:1 -map 0:3 -to 00:59:01 -c:v libx265 -crf 20 -preset medium -c:a aac -c:s dvdsub film.mkv
ffmpeg -i film.ts -map 0:0 -map 0:1 -map 0:3 -to 00:59:01 -c:v libx265 -crf 20 -preset medium -c:a libopus -c:s dvdsub film.mkv
Or extract audio using eac3to:
eac3to film.ts 2:audio.aac
Then do ffmpeg:
ffmpeg -i film.ts -i audio.aac -map 0:0 -map 1:0 -map 0:3 -to 00:59:01 -c:v libx265 -crf 20 -preset medium -c:a copy -c:s dvdsub film.mkv -
Good
VLC can play the latm_aac in the original MPEG-TS-file so why not in the MKV-file (but mayby that a question for a VLC tread)
Is there any advantage to using eac3to first?
When doing the audio converting in ffmpeg how to set the audio sampling rate and the biterate to 112 kbps?
I tried this (with no luck): ffmpeg -i film.ts -map 0:0 -map 0:1 -map 0:3 -ss 0:03:22 -to 00:45:20 -c:v libx265 -crf 20 -preset medium -c:a aac -ar 41100 -aq 112 -c:s dvdsub film.mkv -
General
ID : 1 (0x1)
Complete name : D:\ffmpeg\bin\film 01.ts
Format : MPEG-TS
File size : 2.14 GiB
Duration : 1 h 8 min
Overall bit rate mode : Variable
Overall bit rate : 4 464 kb/s
Network name : Kabelplus
Original network name : 1 degree W (Telenor)
Video
ID : 757 (0x2F5)
Menu ID : 37 (0x25)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Format settings, picture structure : Frame
Codec ID : 27
Duration : 1 h 8 min
Width : 704 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 FPS
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan type, store method : Interleaved fields
Scan order : Top Field First
Color range : Limited
Color primaries : BT.601 PAL
Transfer characteristics : BT.470 System B, BT.470 System G
Matrix coefficients : BT.601
Audio
ID : 758 (0x2F6)
Menu ID : 37 (0x25)
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : HE-AAC / LC
Muxing mode : LATM
Codec ID : 17
Duration : 1 h 8 min
Bit rate mode : Variable
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 kHz / 24.0 kHz
Frame rate : 23.438 FPS (1024 spf)
Compression mode : Lossy
Delay relative to video : -178 ms
Language : Danish
Text #1
ID : 760 (0x2F8)
Menu ID : 37 (0x25)
Format : DVB Subtitle
Codec ID : 6
Delay relative to video : 17 s 695 ms
Language : Danish
Text #2
ID : 761 (0x2F9)
Menu ID : 37 (0x25)
Format : DVB Subtitle
Codec ID : 6
Delay relative to video : 17 s 685 ms
Language : Danish
Other
ID : 759 (0x2F7)-100
Menu ID : 37 (0x25)
Format : Teletext
Codec ID : 6
Duration : 1 h 8 min
Delay relative to video : -640 ms
Language : Danish
Menu
ID : 69 (0x45)
Menu ID : 37 (0x25)
Duration : 1 h 8 min
List : 757 (0x2F5) (AVC) / 758 (0x2F6) (AAC, Danish) / 759 (0x2F7)-100 (Teletext, da) / 760 (0x2F8) (DVB Subtitle, Danish) / 761 (0x2F9) (DVB Subtitle, Danish) / 762 (0x2FA) () / 763 (0x2FB) ()
Language : / Danish / Danish / Danish / Danish -
-
It will not be smaller. Size is determined by bitrate * duration. If you set bitrate to 112k that will determine the size. The sampling rate is not part of the formula.
-
Thanks to you all - With your help and especially "Sneaker" I got a break through with ffmpeg
But of course more questions comes to my mind - fell free to answer them or not:
If you want a "proof" video file with compatibility with older devices and tvs- could that be the video:
ffmpeg -i film.ts -c:v libx264 -profile:v baseline -level 3.0 film.mkv
I don't know for the audio (not to mention the subtitle)
Many of my recorded videos sound is to low - is there a way to normalize the sound level?
is there code for "burn-in subtitles"?
Similar Threads
-
.ts DVB with dvbsubtitles --> mkv with subtitles (wrong subtitle position)
By smellycat3 in forum Video ConversionReplies: 2Last Post: 27th Dec 2015, 16:45 -
ffmpeg - How to combine two Filters ... Black Bands and DVB Subtitles
By mapg in forum Newbie / General discussionsReplies: 4Last Post: 27th Jul 2015, 12:18 -
Using ffmpeg to extract frames from mts file fails
By Prototype v1.0 in forum Video ConversionReplies: 30Last Post: 1st May 2015, 00:39 -
.ts file dvb subtitle
By Romaryho in forum SubtitleReplies: 1Last Post: 21st Jan 2015, 05:02 -
DVB Subtitles in Mpeg TS
By casuva in forum SubtitleReplies: 7Last Post: 30th Nov 2012, 03:19