Segment stream and dump to different output file formats with ffmpeg

Vitor Silva de Deus

I am trying to segment the same stream of data into two file formats(mp4 and ts) using ffmpeg.Dump to one file format each time works just fine:

ffmpeg -loglevel panic -i /dev/dvb/adapter0/dvr0 -f segment -segment_time 240 "outf-%3d.ts"

and

ffmpeg -loglevel panic -i /dev/dvb/adapter0/dvr0 -f segment -segment_time 240 segment_format mp4 "outf-%3d.mp4"

How can I dump the segmented stream to outf.ts and outf.mp4 at the same time(In the same ffmpeg command)?

Gyan

If you want to keep the default encoder selection - mpeg2video and mp2 for TS and H264 and AAC for MP4, use

ffmpeg -loglevel panic -i /dev/dvb/adapter0/dvr0 \
       -f segment -segment_time 240 "outf-%3d.ts" \
       -f segment -segment_time 240 "outf-%3d.mp4"

If you want to encode only once, use

ffmpeg -loglevel panic -i /dev/dvb/adapter0/dvr0 \
       -map 0:v? -map 0:a? -c:v libx264 -c:a aac
       -f tee \ 
       "[f=segment:segment_time=240]outf-%3d.ts| \
        [f=segment:segment_time=240]outf-%3d.mp4"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Dump WebRTC stream to a file

From Dev

Dump WebRTC stream to a file

From Dev

Output RTSP stream with ffmpeg

From Dev

Why are the file formats different?

From Dev

Can I use ffmpeg to output JPEGs to a memory stream instead of a file?

From Dev

Content Negotiation when looking at different output formats

From Dev

FFMPEG Stream and record to file on event

From Dev

Converting different file formats to ebook-supported formats

From Dev

how to output a media stream using ffmpeg?

From Dev

How to convert fabricjs object to different file formats?

From Dev

Handling different log formats in the same file

From Dev

Relative virtual address in different library file formats

From Dev

load csv file with different time formats in r

From Dev

Create stream with FFmpeg from different ip

From Dev

FFmpeg iOS -> output file is invalid

From Java

ffmpeg override output file if exists

From Dev

ffmpeg output file is too large

From Dev

FFmpeg iOS -> output file is invalid

From Dev

"permission denied" for pg_dump output file

From Dev

How to dump the foreach loop output into a file in PowerShell?

From Dev

How to dump the foreach loop output into a file in PowerShell?

From Dev

ffmpeg stereo to mono conversion produces different result when piping the output vs writing to a file

From Dev

PostgreSQL - dump each table into a different file

From Dev

Using NodaTime to parse an input and output different dateTime formats

From Dev

Using NodaTime to parse an input and output different dateTime formats

From Dev

What is the output of a piped file stream?

From Dev

ffmpeg stream file to crtmp - How to change the resolution?

From Dev

FFMPEG: Stream a file with original playing rate

From Dev

How To: Separate curl var_dump output into different variables?

Related Related

  1. 1

    Dump WebRTC stream to a file

  2. 2

    Dump WebRTC stream to a file

  3. 3

    Output RTSP stream with ffmpeg

  4. 4

    Why are the file formats different?

  5. 5

    Can I use ffmpeg to output JPEGs to a memory stream instead of a file?

  6. 6

    Content Negotiation when looking at different output formats

  7. 7

    FFMPEG Stream and record to file on event

  8. 8

    Converting different file formats to ebook-supported formats

  9. 9

    how to output a media stream using ffmpeg?

  10. 10

    How to convert fabricjs object to different file formats?

  11. 11

    Handling different log formats in the same file

  12. 12

    Relative virtual address in different library file formats

  13. 13

    load csv file with different time formats in r

  14. 14

    Create stream with FFmpeg from different ip

  15. 15

    FFmpeg iOS -> output file is invalid

  16. 16

    ffmpeg override output file if exists

  17. 17

    ffmpeg output file is too large

  18. 18

    FFmpeg iOS -> output file is invalid

  19. 19

    "permission denied" for pg_dump output file

  20. 20

    How to dump the foreach loop output into a file in PowerShell?

  21. 21

    How to dump the foreach loop output into a file in PowerShell?

  22. 22

    ffmpeg stereo to mono conversion produces different result when piping the output vs writing to a file

  23. 23

    PostgreSQL - dump each table into a different file

  24. 24

    Using NodaTime to parse an input and output different dateTime formats

  25. 25

    Using NodaTime to parse an input and output different dateTime formats

  26. 26

    What is the output of a piped file stream?

  27. 27

    ffmpeg stream file to crtmp - How to change the resolution?

  28. 28

    FFMPEG: Stream a file with original playing rate

  29. 29

    How To: Separate curl var_dump output into different variables?

HotTag

Archive