Opened 4 years ago

Closed 4 years ago

#2138 closed enhancement (fixed)

this video is not segmented correct

Reported by: mpapp Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: segment
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Summary of the bug:
How to reproduce:

Try this command, this should produce many segments but it does not.
It just makes one.
./ffmpeg -i 'http://1.dlteh.net/Music/Album/Alicia%20Keys%20-%20Girl%20On%20Fire%20320/06.%20Girl%20On%20Fire%20(Inferno%20Version)%20(Feat.%20Nicki%20Minaj).mp3' -codec copy -map 0 -f segment -segment_list 8ff5aa7e2f86849db599b1791eaaaef669514e95_playlist.m3u8 -segment_list_flags +live -segment_time 10 8ff5aa7e2f86849db599b1791eaaaef669514e95_%03d.mkv

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (11)

comment:1 Changed 4 years ago by mpapp

  • Version changed from unspecified to git-master

comment:2 Changed 4 years ago by cehoyos

Is the problem only reproducible with network input or also if you use a file?

To make this a valid ticket, please add your command line together with complete, uncut console output.

comment:3 Changed 4 years ago by mpapp

I can reproduce with the file.

comment:4 Changed 4 years ago by mpapp

root@video-dev:~/ffmpeg/ffmpeg# ./ffmpeg -i 'http://1.dlteh.net/Music/Album/Alicia%20Keys%20-%20Girl%20On%20Fire%20320/06.%20Girl%20On%20Fire%20(Inferno%20Version)%20(Feat.%20Nicki%20Minaj).mp3' -codec copy -map 0 -f segment -segment_list 8ff5aa7e2f86849db599b1791eaaaef669514e95_playlist.m3u8 -segment_list_flags +live -segment_time 10 8ff5aa7e2f86849db599b1791eaaaef669514e95_%03d.mp4
ffmpeg version git-2013-01-10-5b69c07 Copyright (c) 2000-2013 the FFmpeg developers

built on Jan 9 2013 19:00:56 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
configuration: --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enable-bzlib --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvorbis --enable-libx264 --enable-zlib
libavutil 52. 13.100 / 52. 13.100
libavcodec 54. 86.100 / 54. 86.100
libavformat 54. 59.107 / 54. 59.107
libavdevice 54. 3.102 / 54. 3.102
libavfilter 3. 32.100 / 3. 32.100
libswscale 2. 1.103 / 2. 1.103
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100

[mp3 @ 0x29a8f60] Warning: not compiled with thread support, using thread emulation
[mjpeg @ 0x29b0040] Warning: not compiled with thread support, using thread emulation
[mp3 @ 0x29a3b00] max_analyze_duration 5000000 reached at 5015510
Input #0, mp3, from 'http://1.dlteh.net/Music/Album/Alicia%20Keys%20-%20Girl%20On%20Fire%20320/06.%20Girl%20On%20Fire%20(Inferno%20Version)%20(Feat.%20Nicki%20Minaj).mp3':

Metadata:

artist : Girl On Fire
Teh-Music.Com ::
album : Alicia Keys
Teh-Music.Com ::
genre :
Teh-Music.Com :: date : 2012 Duration: 00:04:30.76, start: 0.000000, bitrate: 240 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s Stream #0:1: Video: mjpeg, yuvj420p, 600x600 [SAR 96:96 DAR 1:1], 90k tbr, 90k tbn, 90k tbc Metadata: title : comment : Cover (front)

Output #0, segment, to '8ff5aa7e2f86849db599b1791eaaaef669514e95_%03d.mp4':

Metadata:

artist : Girl On Fire
Teh-Music.Com ::
album : Alicia Keys
Teh-Music.Com ::
genre :
Teh-Music.Com :: date : 2012 encoder : Lavf54.59.107 Stream #0:0: Audio: mp3, 44100 Hz, stereo, 320 kb/s Stream #0:1: Video: mjpeg, yuvj420p, 600x600 [SAR 96:96 DAR 1:1], q=2-31, 90k tbn, 90k tbc Metadata: title : comment : Cover (front)

Stream mapping:

Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)

Press [q] to stop, ? for help
frame= 1 fps=0.0 q=-1.0 Lsize=N/A time=00:04:30.75 bitrate=N/A
video:68kB audio:7882kB subtitle:0 global headers:0kB muxing overhead -100.000270%
root@video-dev:~/ffmpeg/ffmpeg#

Version 0, edited 4 years ago by mpapp (next)

comment:5 Changed 4 years ago by saste

  • Analyzed by developer set
  • Component changed from undetermined to avformat
  • Keywords segment added
  • Status changed from new to open

Hi,

this is expected since the segment will use by default the video as reference stream.
As a workaround, you can use reference_stream a to force audio as reference. I'm not sure if we should change the default to ignore video streams which are attachments, comments are welcome.

comment:6 follow-up: Changed 4 years ago by mpapp

There is video. Why is it not cut into X s pieces if it is a reference?

As a end user, I expect when I use segment, the output should be cut into X s pieces.

It did not happen.
What is complicated about it?

Last edited 4 years ago by mpapp (previous) (diff)

comment:7 in reply to: ↑ 6 Changed 4 years ago by saste

Replying to mpapp:

There is video. Why is it not cut into X s pieces if it is a reference?

As a end user, I expect when I use segment, the output should be cut into X s pieces.

It did not happen.
What is complicated about it?

Because you are splitting assuming the video stream as a reference. If the video stream has only one key frame, you get only one segment. There are several workarounds, but no magic solution.

comment:8 follow-up: Changed 4 years ago by mpapp

I guess there could be a double reference mode.
In which ,both stream could be watched. Whichever changes most that one should be used as a reference for that segment.

I guess the problem is if I use sound as a reference, and there is no sound or it does not change, I will bump into the same phenomena, do not you think?

comment:9 in reply to: ↑ 8 Changed 4 years ago by saste

Replying to mpapp:

I guess there could be a double reference mode.

In which ,both stream could be watched.

No idea what you mean.

Whichever changes most that one should be used as a reference for that segment.

This in not well defined. Also you break video segmenting if you use audio as reference for an input with audio and video, for a normal video which comprises more than one keyframe (like in your case).

I guess the problem is if I use sound as a reference, and there is no sound or it does not change, I will bump into the same phenomena, do not you think?

You can script things (e.g. with ffprobe), see what streams your input contains and change the -reference_stream value accordingly. Alternatively, I could change the default so that in case the video is an "attached picture" it is not used as a reference.

Last edited 4 years ago by saste (previous) (diff)

comment:10 follow-up: Changed 4 years ago by mpapp

Yes, I can use script.
It would make sense too not to use video if it is an attached picture.

comment:11 in reply to: ↑ 10 Changed 4 years ago by saste

  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from open to closed
  • Type changed from defect to enhancement

Replying to mpapp:

Yes, I can use script.
It would make sense too not to use video if it is an attached picture.

Should be fixed in:

commit d00df260ca3341e5cacdd53fb08c42b05fb1d442
Author: Stefano Sabatini <stefasab@gmail.com>
Date:   Wed Jan 16 20:10:12 2013 +0100

    lavf/segment: do not auto-select a video stream with attached_pic disposition
    
    In particular, fix trac ticket #2138.
Note: See TracTickets for help on using tickets.