VideoHelp Forum
+ Reply to Thread
Results 1 to 23 of 23
Thread
  1. 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/s
    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 need to extract the stream #0:3

    I have been trying this (My file is named "film"):
    ffmpeg -i film.ts -map 0:3 -scodec dvdsub film.srt
    It does not work
    Quote Quote  
  2. "It does not work" is a bad error description. That said, I have never been able to extract dvb_subtitle from ts successfully using ffmpeg. Try ProjectX. If you upload a sample others may give you more suggestions.
    Quote Quote  
  3. 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
    Quote Quote  
  4. I see.
    If you are ok with OCR try Subtitle Edit.
    Quote Quote  
  5. 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
    Quote Quote  
  6. 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.
    Quote Quote  
  7. Originally Posted by T-buch View Post
    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
    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.
    Quote Quote  
  8. 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
    Quote Quote  
  9. Actually I just need a file so Handbrake can see the subtitle - so any and every ideas in that way, I welcome very much
    Quote Quote  
  10. 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/HowToBurnSubtitlesIntoVideo
    Last edited by sneaker; 11th Mar 2017 at 07:37.
    Quote Quote  
  11. 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)
    Quote Quote  
  12. 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 copy -c:s dvdsub film.mkv
    Quote Quote  
  13. It works except that there is no sound in VLC ?? (It works fine in ffplay.exe)
    Quote Quote  
  14. 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
    Quote Quote  
  15. 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
    Quote Quote  
  16. Member netmask56's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Search Comp PM
    Post a MediaInfo report on the TS file
    SONY 75" Full array 200Hz LED TV, Yamaha A1070 amp, Zidoo UHD3000, BeyonWiz PVR V2 (Enigma2 clone), Chromecast, Windows 11 Professional, QNAP NAS TS851
    Quote Quote  
  17. Originally Posted by T-buch View Post
    Is there any advantage to using eac3to first?
    The eac3to+ffmpeg solution losslessly copies the audio instead of re-encoding.

    Originally Posted by T-buch View Post
    -ar 41100 -aq 112
    -ar 41100 -b:a 112k
    (But I would not set -ar. It will use the one in the source which is 48000 and pretty much standard for video files.)
    Quote Quote  
  18. Originally Posted by netmask56 View Post
    Post a MediaInfo report on the TS file
    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
    Quote Quote  
  19. Originally Posted by sneaker View Post
    Originally Posted by T-buch View Post
    Is there any advantage to using eac3to first?
    The eac3to+ffmpeg solution losslessly copies the audio instead of re-encoding.

    Originally Posted by T-buch View Post
    -ar 41100 -aq 112
    -ar 41100 -b:a 112k
    (But I would not set -ar. It will use the one in the source which is 48000 and pretty much standard for video files.)
    Okay I see
    I just wanted 41100 cause I thought the file would be smaller (However, it is probably very little).
    Quote Quote  
  20. 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.
    Quote Quote  
  21. Member netmask56's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Search Comp PM
    TSDoctor should handle that file OK - but it is payware after a trial period.
    SONY 75" Full array 200Hz LED TV, Yamaha A1070 amp, Zidoo UHD3000, BeyonWiz PVR V2 (Enigma2 clone), Chromecast, Windows 11 Professional, QNAP NAS TS851
    Quote Quote  
  22. 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"?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!